wg_nmcli Ordner hinzugefügt Pfade angepasst

This commit is contained in:
Désiré Werner Menrath 2023-11-20 12:28:28 +01:00
parent 6fe7e7c989
commit 92ae78f5a8
4 changed files with 26 additions and 17 deletions

View File

@ -50,7 +50,6 @@ elif grep -i 'suse' /etc/os-release > /dev/null 2>&1
else else
exit 1 exit 1
fi fi
else else
clear clear
echo Ihr system konnte nicht ermittelt werden. echo Ihr system konnte nicht ermittelt werden.
@ -60,13 +59,23 @@ else
exit 0 exit 0
fi fi
if [ -d /home/$USER/.config/autostart ] # for GNOME, XFCE, KDE, Budgie if [ ! -d /home/"$USER"/.local/share ]
then then
cp .wgonstart.desktop /home/$USER/.config/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
elif [ -d /home/$USER/.config/lxsession/Lubuntu/autostart ] # for LXDE if [ -d /home/"$USER"/.config/autostart ] # for GNOME, XFCE, KDE, Budgie
then then
cp .wgonstart.desktop /home/$USER/.config/lxsession/Lubuntu/autostart/ 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 else
echo Autostartdir not found! echo Autostartdir not found!

View File

@ -1,7 +1,7 @@
[Desktop Entry] [Desktop Entry]
Type=Application Type=Application
Name=wg_on_start Name=wg_on_start
Name[de_DE]=.wgonstart.desktop Name[de_DE]=wgonstart.desktop
Exec=wg_on_start Exec=wg_on_start
NoDisplay=true NoDisplay=true
Terminal=false Terminal=false

View File

@ -49,18 +49,18 @@ ACTIVE=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/
then then
if grep 'TRUE TRUE\|TRUE FALSE' ${WG_WDIR}about.txt if grep 'TRUE TRUE\|TRUE FALSE' ${WG_WDIR}about.txt
then 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 else
mv /home/"$USER"/.config/autostart/wgonstart.desktop /home/"$USER"/.config/autostart/.wgonstart.desktop rm /home/"$USER"/.config/autostart/wgonstart.desktop
fi fi
elif [ -d /home/$USER/.config/lxsession/Lubuntu/autostart ] # for LXDE elif [ -d /home/$USER/.config/lxsession/Lubuntu/autostart ] # for LXDE
then then
if grep 'TRUE TRUE\|TRUE FALSE' ${WG_WDIR}about.txt if grep 'TRUE TRUE\|TRUE FALSE' ${WG_WDIR}about.txt
then 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 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
fi fi

8
wire_g
View File

@ -59,18 +59,18 @@ wg_notify(){
then then
if grep 'TRUE TRUE\|TRUE FALSE' ${WG_WDIR}about.txt if grep 'TRUE TRUE\|TRUE FALSE' ${WG_WDIR}about.txt
then 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 else
mv /home/"$USER"/.config/autostart/.wgonstart.desktop /home/"$USER"/.config/autostart/.wgonstart.desktop rm /home/"$USER"/.config/autostart/wgonstart.desktop
fi fi
elif [ -d /home/$USER/.config/lxsession/Lubuntu/autostart ] # for LXDE elif [ -d /home/$USER/.config/lxsession/Lubuntu/autostart ] # for LXDE
then then
if grep 'TRUE TRUE\|TRUE FALSE' ${WG_WDIR}about.txt if grep 'TRUE TRUE\|TRUE FALSE' ${WG_WDIR}about.txt
then 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 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
fi fi