From 5dbd7823067fa0515fddba1ebff47e9687ffe094 Mon Sep 17 00:00:00 2001 From: punix Date: Mon, 30 Oct 2023 18:31:27 +0100 Subject: [PATCH] =?UTF-8?q?selection=20if=20abfrage=20angepasst=20(else=20?= =?UTF-8?q?hinzugef=C3=BCgt)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wire_g | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wire_g b/wire_g index 6bb9527..400e46a 100755 --- a/wire_g +++ b/wire_g @@ -173,9 +173,15 @@ selection=$(yad --no-click --list \ --column 'Auswahl' $tunnel) if [ "$?" = "0" ] then + active=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//') + if [ -n $active ] + then wg_stop nmcli connection up $selection &> ${wg_wdir}.tmp.txt connect + else + nmcli connection up $selection &> ${wg_wdir}.tmp.txt + connect fi ############################################ ENDE #########################################################