diff --git a/installer1.0.5 b/installer1.0.5 index 690582d..ada7426 100755 --- a/installer1.0.5 +++ b/installer1.0.5 @@ -49,8 +49,7 @@ elif grep -i 'suse' /etc/os-release > /dev/null 2>&1 else exit 1 - fi - + fi else clear echo Ihr system konnte nicht ermittelt werden. @@ -60,13 +59,23 @@ else exit 0 fi -if [ -d /home/$USER/.config/autostart ] # for GNOME, XFCE, KDE, Budgie - then - cp .wgonstart.desktop /home/$USER/.config/autostart/ - -elif [ -d /home/$USER/.config/lxsession/Lubuntu/autostart ] # for LXDE +if [ ! -d /home/"$USER"/.local/share ] then - cp .wgonstart.desktop /home/$USER/.config/lxsession/Lubuntu/autostart/ + mkdir -p /home/"$USER"/.local/share + cp -r wg_nmcli /home/"$USER"/.local/share/ + else + cp -r wg_nmcli /home/"$USER"/.local/share/ +fi + +if [ -d /home/"$USER"/.config/autostart ] # for GNOME, XFCE, KDE, Budgie + then + cp .wgonstart.desktop /home/"$USER"/.config/autostart/ + +fi + +elif [ -d /home/"$USER"/.config/lxsession/Lubuntu/autostart ] # for LXDE + then + cp .wgonstart.desktop /home/"$USER"/.config/lxsession/Lubuntu/autostart/ else echo Autostartdir not found! diff --git a/.wgonstart.desktop b/wg_nmcli/wgonstart.desktop similarity index 87% rename from .wgonstart.desktop rename to wg_nmcli/wgonstart.desktop index 57166e1..451dba8 100644 --- a/.wgonstart.desktop +++ b/wg_nmcli/wgonstart.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Type=Application Name=wg_on_start -Name[de_DE]=.wgonstart.desktop +Name[de_DE]=wgonstart.desktop Exec=wg_on_start NoDisplay=true Terminal=false diff --git a/wg_on_start b/wg_on_start index 2e20476..b2aa578 100644 --- a/wg_on_start +++ b/wg_on_start @@ -49,18 +49,18 @@ ACTIVE=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ then if grep 'TRUE TRUE\|TRUE FALSE' ${WG_WDIR}about.txt then - mv /home/"$USER"/.config/autostart/.wgonstart.desktop /home/"$USER"/.config/autostart/wgonstart.desktop + cp /home/"$USER"/.local/share/wg_nmcli/wgonstart.desktop /home/"$USER"/.config/autostart/ else - mv /home/"$USER"/.config/autostart/wgonstart.desktop /home/"$USER"/.config/autostart/.wgonstart.desktop + rm /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 + cp /home/"$USER"/.local/share/wg_nmcli/wgonstart.desktop /home/$USER/.config/lxsession/Lubuntu/autostart/ else - mv /home/$USER/.config/lxsession/Lubuntu/autostart/wgonstart.desktop /home/$USER/.config/lxsession/Lubuntu/autostart/.wgonstart.desktop + rm /home/$USER/.config/lxsession/Lubuntu/autostart/wgonstart.desktop fi fi diff --git a/wire_g b/wire_g index 0327d82..90731a0 100755 --- a/wire_g +++ b/wire_g @@ -59,18 +59,18 @@ wg_notify(){ then if grep 'TRUE TRUE\|TRUE FALSE' ${WG_WDIR}about.txt then - mv /home/"$USER"/.config/autostart/.wgonstart.desktop /home/"$USER"/.config/autostart/wgonstart.desktop + cp /home/"$USER"/.local/share/wg_nmcli/wgonstart.desktop /home/"$USER"/.config/autostart/ else - mv /home/"$USER"/.config/autostart/.wgonstart.desktop /home/"$USER"/.config/autostart/.wgonstart.desktop + rm /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 + cp /home/"$USER"/.local/share/wg_nmcli/wgonstart.desktop /home/$USER/.config/lxsession/Lubuntu/autostart/ else - mv /home/$USER/.config/lxsession/Lubuntu/autostart/wgonstart.desktop /home/$USER/.config/lxsession/Lubuntu/autostart/.wgonstart.desktop + rm /home/$USER/.config/lxsession/Lubuntu/autostart/wgonstart.desktop fi fi