From 0f339b48f553e0efe46536e4f08a8f2ba8055a6e Mon Sep 17 00:00:00 2001 From: punix Date: Tue, 14 Nov 2023 12:42:40 +0100 Subject: [PATCH] test 5 mit remove --- wire_g | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/wire_g b/wire_g index 4b5c3d7..d9e45c9 100755 --- a/wire_g +++ b/wire_g @@ -221,7 +221,7 @@ connect(){ ############################################################################################################ # --text "Aktiver Tunnel: $active # mit gewünschtes wort wird fett geschrieben. # Farbe für Variable $active festgelegt mit fetter Schrift. (bei --text zwischen " ") -if selection=$(yad --no-klick --list --center \ +selection=$(yad --no-klick --list --center \ --height=300 --width=60 --title="Wire-G" \ --buttons-layout=center \ --button=$"Start:0" --button=$"Stop":"bash -c up_or_down" \ @@ -235,18 +235,6 @@ if selection=$(yad --no-klick --list --center \ ---------------------------------------------------------------------------------- If no tunnels are listed, so they have to import their tunnel beforehand.") - - then - 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 - ret=$? [[ $? -eq 1 ]] && exit 0 @@ -256,6 +244,17 @@ if [[ $ret -eq 4 ]] remove fi +if [[ $ret -eq 0 ]] + then + 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 fi