From 92ae78f5a8d457620b6e1f2759fcca0aafeb376e Mon Sep 17 00:00:00 2001 From: punix Date: Mon, 20 Nov 2023 12:28:28 +0100 Subject: [PATCH] =?UTF-8?q?wg=5Fnmcli=20Ordner=20hinzugef=C3=BCgt=20=20=20?= =?UTF-8?q?=20Pfade=20angepasst?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- installer1.0.5 | 25 +++++++++++++------ .../wgonstart.desktop | 2 +- wg_on_start | 8 +++--- wire_g | 8 +++--- 4 files changed, 26 insertions(+), 17 deletions(-) rename .wgonstart.desktop => wg_nmcli/wgonstart.desktop (87%) 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