diff --git a/wg_on_start b/wg_on_start index 236ef2f..1a4b838 100644 --- a/wg_on_start +++ b/wg_on_start @@ -35,15 +35,11 @@ ACTIVE=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ # # *) OPEN=open ;; # esac - yad --image-on-top --image=${WG_PIC}wg-vpn-info.png \ - --undecorated --borders=8 --skip-taskbar \ - --text-align=center --no-buttons --auto-close \ - --timeout 1 \ - --text=$"$ACTIVE powered" - - # 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 + yad --image-on-top --image=${WG_PIC}wg-vpn-info.png \ + --undecorated --borders=8 --skip-taskbar \ + --text-align=center --no-buttons --auto-close \ + --timeout 1 \ + --text=$"$ACTIVE powered" yad --notification \ --image="${WG_PIC}wg-vpn.png" \ diff --git a/wire_g b/wire_g index 9c2ba98..4ddad00 100755 --- a/wire_g +++ b/wire_g @@ -37,7 +37,7 @@ ACTIVE=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ ############################################################################################################ wg_notify(){ - sleep 2 + sleep 1 nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//' &> ${WG_WDIR}onstart.txt ACTIVE=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//') case $LANG in @@ -51,9 +51,6 @@ wg_notify(){ --text-align=center --no-buttons --auto-close \ --timeout 1 \ --text=$"$ACTIVE powered" - # 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 yad --notification \ --image="${WG_PIC}wg-vpn.png" \ @@ -102,10 +99,12 @@ import_wg(){ then wg_stop nmcli connection import type wireguard file $WG_CONF &> ${WG_WDIR}.tmp.txt + nmcli con mod "$WG_CONF" connection.autoconnect no wg_notify else kill $lines nmcli connection import type wireguard file $WG_CONF &> ${WG_WDIR}.tmp.txt + nmcli con mod "$WG_CONF" connection.autoconnect no wg_notify fi nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//' &> ${WG_WDIR}onstart.txt