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