notify wg_on_start hinzugefügt

This commit is contained in:
Désiré Werner Menrath 2023-11-19 15:59:41 +01:00
parent db2799eab3
commit 3d27bdde18
2 changed files with 16 additions and 20 deletions

View File

@ -40,15 +40,13 @@ WG_PIC="/home/$USER/.icons/"
# autoconnect wird hier abgeschalten damit auch neu importierte nach einem Systemneustart nicht aktiv sind
IFS=$'\n' lines=( $(cat ${WG_WDIR}tunnel.txt) )
nmcli con mod "$lines" connection.autoconnect no
# if AUTOSTART=$(grep 'TRUE TRUE\|TRUE FALSE' ${WG_WDIR}about.txt)
# then
# nmcli con mod "$ACTIVE" connection.autoconnect yes
# if [ -d /etc/xdg/autostart ]
# then
# echo "Autostartordner in /etc/xdg/ gefunden"
# elif [ -d /usr/share/autostart ]
# then
# fi
if grep 'TRUE TRUE\|TRUE FALSE' ${WG_WDIR}about.txt
then
chmod +x /home/"$USER"/.local/bin/wg_on_start
else
chmod -x /home/"$USER"/.local/bin/wg_on_start
fi
yad --notification \
--image="${WG_PIC}wg-vpn.png" \
--icon-size=32 --no-middle \

18
wire_g
View File

@ -52,15 +52,14 @@ wg_notify(){
# autoconnect wird hier abgeschalten damit auch neu importierte nach einem Systemneustart nicht aktiv sind
IFS=$'\n' lines=( $(cat ${WG_WDIR}tunnel.txt) )
nmcli con mod "$lines" connection.autoconnect no
# if AUTOSTART=$(grep 'TRUE TRUE\|TRUE FALSE' ${WG_WDIR}about.txt)
# then
# nmcli con mod "$ACTIVE" connection.autoconnect yes
# if [ -d /etc/xdg/autostart ]
# then
# echo "Autostartordner in /etc/xdg/ gefunden"
# elif [ -d /usr/share/autostart ]
# then
# fi
if grep 'TRUE TRUE\|TRUE FALSE' ${WG_WDIR}about.txt
then
chmod +x /home/"$USER"/.local/bin/wg_on_start
else
chmod -x /home/"$USER"/.local/bin/wg_on_start
fi
yad --notification \
--image="${WG_PIC}wg-vpn.png" \
--icon-size=32 --no-middle \
@ -262,7 +261,6 @@ connect(){
if SUCCESS=$(grep -i 'erfolgreich aktiviert\|successfully activated' ${WG_WDIR}.tmp.txt)
then
nmcli con mod $SELECTION connection.autoconnect no
wg_notify
fi }