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