Bei import if -n $active hinzugefügt
funktionen lesbarkeit angepasst
This commit is contained in:
parent
5bebb7ccaf
commit
298f3998d3
13
wire_g
13
wire_g
@ -63,10 +63,17 @@ import_wg(){
|
||||
--window-icon=${wg_pic}wg-import.png \
|
||||
--title="Wireguard .conf Datei auswählen")
|
||||
if [ "$?" = "0" ]
|
||||
then
|
||||
active=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//')
|
||||
if [ -n $active ]
|
||||
then
|
||||
wg_stop
|
||||
nmcli connection import type wireguard file $wgconf > ${wg_wdir}.tmp.txt
|
||||
wg_notify
|
||||
else
|
||||
nmcli connection import type wireguard file $wgconf > ${wg_wdir}.tmp.txt
|
||||
wg_notify
|
||||
fi
|
||||
fi }
|
||||
export -f import_wg
|
||||
|
||||
@ -136,7 +143,7 @@ more(){
|
||||
--button=Importieren:"bash -c import_wg" \
|
||||
--button="Wire-G Stop":"bash -c wg_stop" \
|
||||
--button="Abbrechen":1 \
|
||||
--separator="" --window-icon=${wg_pic}wg-vpn.png )
|
||||
--separator="" --window-icon=${wg_pic}wg-vpn.png)
|
||||
}
|
||||
export -f more
|
||||
# function end
|
||||
@ -171,7 +178,7 @@ selection=$(yad --no-click --list \
|
||||
<b>Sollten keine Tunnel aufgelistet sein,</b>
|
||||
<b>so müssen sie ihren Tunnel zuvor importieren.</b>" \
|
||||
--column 'Auswahl' $tunnel)
|
||||
if [ "$?" = "0" ]
|
||||
if [ "$?" = "0" ]
|
||||
then
|
||||
active=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//')
|
||||
if [ -n $active ]
|
||||
@ -183,7 +190,7 @@ selection=$(yad --no-click --list \
|
||||
nmcli connection up $selection &> ${wg_wdir}.tmp.txt
|
||||
connect
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
############################################ ENDE #########################################################
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user