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 }