Bei import if -n $active hinzugefügt
funktionen lesbarkeit angepasst
This commit is contained in:
parent
5bebb7ccaf
commit
298f3998d3
7
wire_g
7
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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user