selection if abfrage angepasst (else hinzugefügt)

This commit is contained in:
Désiré Werner Menrath 2023-10-30 18:31:27 +01:00
parent 35373f4e4e
commit 5dbd782306

6
wire_g
View File

@ -172,10 +172,16 @@ selection=$(yad --no-click --list \
<b>so müssen sie ihren Tunnel zuvor importieren.</b>" \ <b>so müssen sie ihren Tunnel zuvor importieren.</b>" \
--column 'Auswahl' $tunnel) --column 'Auswahl' $tunnel)
if [ "$?" = "0" ] if [ "$?" = "0" ]
then
active=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//')
if [ -n $active ]
then then
wg_stop wg_stop
nmcli connection up $selection &> ${wg_wdir}.tmp.txt nmcli connection up $selection &> ${wg_wdir}.tmp.txt
connect connect
else
nmcli connection up $selection &> ${wg_wdir}.tmp.txt
connect
fi fi
############################################ ENDE ######################################################### ############################################ ENDE #########################################################