From 3d27bdde18b48cf3548ab9a69d051564461e9735 Mon Sep 17 00:00:00 2001 From: punix Date: Sun, 19 Nov 2023 15:59:41 +0100 Subject: [PATCH] =?UTF-8?q?notify=20wg=5Fon=5Fstart=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wg_on_start | 16 +++++++--------- wire_g | 20 +++++++++----------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/wg_on_start b/wg_on_start index fff650e..1ad7a73 100644 --- a/wg_on_start +++ b/wg_on_start @@ -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 \ diff --git a/wire_g b/wire_g index c992da4..6afc8be 100755 --- a/wire_g +++ b/wire_g @@ -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 \ @@ -261,8 +260,7 @@ fi connect(){ if SUCCESS=$(grep -i 'erfolgreich aktiviert\|successfully activated' ${WG_WDIR}.tmp.txt) - then - nmcli con mod $SELECTION connection.autoconnect no + then wg_notify fi }