installar and uninstaller angepasst

This commit is contained in:
Désiré Werner Menrath 2023-11-19 20:44:29 +01:00
parent f1496fac9b
commit 2541ed9d34
4 changed files with 49 additions and 17 deletions

View File

@ -62,13 +62,11 @@ fi
if [ -d /home/$USER/.config/autostart ] # for GNOME, XFCE, KDE, Budgie if [ -d /home/$USER/.config/autostart ] # for GNOME, XFCE, KDE, Budgie
then then
cp wg_on_start.desktop /home/$USER/.config/autostart/ cp wgonstart.desktop /home/$USER/.config/autostart/
chmod +x /home/$USER/.config/autostart/wg_on_start.desktop
elif [ -d /home/$USER/.config/lxsession/Lubuntu/autostart ] # for LXDE elif [ -d /home/$USER/.config/lxsession/Lubuntu/autostart ] # for LXDE
then then
cp wg_on_start.desktop /home/$USER/.config/lxsession/Lubuntu/autostart/ cp wgonstart.desktop /home/$USER/.config/lxsession/Lubuntu/autostart/
chmod +x /home/$USER/.config/lxsession/Lubuntu/autostart/wg_on_start.desktop
else else
echo Autostartdir not found! echo Autostartdir not found!

View File

@ -13,7 +13,17 @@
cd || exit cd || exit
rm -f /home/"$USER"/.icons/wg-active.png wg-stop.png wg-vpn.png wg-import.png wg-trash.png wg-info.png wg-vpn-info.png rm -f /home/"$USER"/.icons/wg-active.png wg-stop.png wg-vpn.png wg-import.png wg-trash.png wg-info.png wg-vpn-info.png
wait; wait;
rm -r /home/"$USER"/.config/wg_nmcli ; rm /home/$USER/.config/autostart/wg_on_start.desktop ; rm /sbin/wg_on_start rm -r /home/"$USER"/.config/wg_nmcli ; rm /sbin/wg_on_start
if [ -d /home/$USER/.config/autostart ] # for GNOME, XFCE, KDE, Budgie
then
rm /home/$USER/.config/autostart/wgonstart.desktop > /dev/null 2>&1
rm /home/$USER/.config/autostart/.wgonstart.desktop > /dev/null 2>&1
elif [ -d /home/$USER/.config/lxsession/Lubuntu/autostart ] # for LXDE
then
rm /home/$USER/.config/lxsession/Lubuntu/autostart/wgonstart.desktop > /dev/null 2>&1
rm /home/$USER/.config/lxsession/Lubuntu/autostart/.wgonstart.desktop > /dev/null 2>&1
fi
wait; wait;
sudo rm /usr/share/icons/Arch-Symbole/wg-vpn.png ; sudo rm /sbin/wire_g ; sudo rm /sbin/wg_stop sudo rm /usr/share/icons/Arch-Symbole/wg-vpn.png ; sudo rm /sbin/wire_g ; sudo rm /sbin/wg_stop
wait; wait;

View File

@ -45,11 +45,23 @@ ACTIVE=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/
IFS=$'\n' lines=( $(cat ${WG_WDIR}tunnel.txt) ) IFS=$'\n' lines=( $(cat ${WG_WDIR}tunnel.txt) )
nmcli con mod "$lines" connection.autoconnect no nmcli con mod "$lines" connection.autoconnect no
if grep 'TRUE TRUE\|TRUE FALSE' ${WG_WDIR}about.txt if [ -d /home/$USER/.config/autostart ] # for GNOME, XFCE, KDE, Budgie
then then
chmod +x /home/"$USER"/.local/bin/wg_on_start if grep 'TRUE TRUE\|TRUE FALSE' ${WG_WDIR}about.txt
else then
chmod -x /home/"$USER"/.local/bin/wg_on_start mv /home/"$USER"/.config/autostart/.wgonstart.desktop mv /home/"$USER"/.config/autostart/wgonstart.desktop
else
mv /home/"$USER"/.config/autostart/.wgonstart.desktop mv /home/"$USER"/.config/autostart/.wgonstart.desktop
fi
elif [ -d /home/$USER/.config/lxsession/Lubuntu/autostart ] # for LXDE
then
if grep 'TRUE TRUE\|TRUE FALSE' ${WG_WDIR}about.txt
then
mv /home/$USER/.config/lxsession/Lubuntu/autostart/.wgonstart.desktop /home/$USER/.config/lxsession/Lubuntu/autostart/wgonstart.desktop
else
mv /home/$USER/.config/lxsession/Lubuntu/autostart/wgonstart.desktop /home/$USER/.config/lxsession/Lubuntu/autostart/.wgonstart.desktop
fi
fi fi
yad --notification \ yad --notification \

24
wire_g
View File

@ -19,7 +19,7 @@ export TEXTDOMAINDIR="/usr/share/locale"
############################################################################################################ ############################################################################################################
############################################################################################################ ############################################################################################################
VERSION=3.1.5 VERSION=3.1.7
# wg_workdir Arbeitsverzeichnis wg # wg_workdir Arbeitsverzeichnis wg
WG_WDIR="/home/$USER/.config/wg_nmcli/" WG_WDIR="/home/$USER/.config/wg_nmcli/"
# Pfad wg Icons # Pfad wg Icons
@ -55,11 +55,23 @@ wg_notify(){
IFS=$'\n' lines=( $(cat ${WG_WDIR}tunnel.txt) ) IFS=$'\n' lines=( $(cat ${WG_WDIR}tunnel.txt) )
nmcli con mod "$lines" connection.autoconnect no nmcli con mod "$lines" connection.autoconnect no
if grep 'TRUE TRUE\|TRUE FALSE' ${WG_WDIR}about.txt if [ -d /home/$USER/.config/autostart ] # for GNOME, XFCE, KDE, Budgie
then then
chmod +x /home/"$USER"/.local/bin/wg_on_start if grep 'TRUE TRUE\|TRUE FALSE' ${WG_WDIR}about.txt
else then
chmod -x /home/"$USER"/.local/bin/wg_on_start mv /home/"$USER"/.config/autostart/.wgonstart.desktop mv /home/"$USER"/.config/autostart/wgonstart.desktop
else
mv /home/"$USER"/.config/autostart/.wgonstart.desktop mv /home/"$USER"/.config/autostart/.wgonstart.desktop
fi
elif [ -d /home/$USER/.config/lxsession/Lubuntu/autostart ] # for LXDE
then
if grep 'TRUE TRUE\|TRUE FALSE' ${WG_WDIR}about.txt
then
mv /home/$USER/.config/lxsession/Lubuntu/autostart/.wgonstart.desktop /home/$USER/.config/lxsession/Lubuntu/autostart/wgonstart.desktop
else
mv /home/$USER/.config/lxsession/Lubuntu/autostart/wgonstart.desktop /home/$USER/.config/lxsession/Lubuntu/autostart/.wgonstart.desktop
fi
fi fi
yad --notification \ yad --notification \