From a1048076b578793faa9f277e434854109eb54274 Mon Sep 17 00:00:00 2001 From: punix Date: Wed, 1 Nov 2023 10:31:14 +0100 Subject: [PATCH] =?UTF-8?q?active=20variable=20bei=20up=5For=5Fdown=20hinz?= =?UTF-8?q?ugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wire_g | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/wire_g b/wire_g index 11bcf43..afa47df 100755 --- a/wire_g +++ b/wire_g @@ -127,18 +127,17 @@ export -f remove ############################################################################################################ #funktion for active tunnel a stop up_or_down(){ - -if [ -z $active ] - then - yad --image-on-top --image=${wg_pic}wg-info.png \ + active=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//') + if [ -z $active ] + then + yad --image-on-top --image=${wg_pic}wg-info.png \ --text="There is no active tunnel that you could stop.\n" \ --text-align=center --button="OK" --title "Wire-G" \ --fixed --center --buttons-layout=center --borders=8 --center -else - wg_stop + else + wg_stop -fi -} + fi } export -f up_or_down # funktion end