import-mit-prüfung-der-Wireguard-Datei
This commit is contained in:
parent
925a358fca
commit
c57279d868
17
wire_g
17
wire_g
@ -79,17 +79,30 @@ import_wg(){
|
|||||||
--width=1200 --height=800 \
|
--width=1200 --height=800 \
|
||||||
--window-icon=${wg_pic}wg-import.png \
|
--window-icon=${wg_pic}wg-import.png \
|
||||||
--title=$"Wireguard .conf Select file")
|
--title=$"Wireguard .conf Select file")
|
||||||
then
|
case $wgconf in
|
||||||
|
*.conf && *_*.conf)
|
||||||
active=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//')
|
active=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//')
|
||||||
if [[ -n $active ]]
|
if [[ -n $active ]]
|
||||||
then
|
then
|
||||||
wg_stop
|
wg_stop
|
||||||
nmcli connection import type wireguard file $wgconf 2> ${wg_wdir}.tmp.txt
|
nmcli connection import type wireguard file $wgconf 2> ${wg_wdir}.tmp.txt
|
||||||
wg_notify
|
wg_notify
|
||||||
else
|
elif [[ -z $active ]]
|
||||||
|
then
|
||||||
nmcli connection import type wireguard file $wgconf 2> ${wg_wdir}.tmp.txt
|
nmcli connection import type wireguard file $wgconf 2> ${wg_wdir}.tmp.txt
|
||||||
wg_notify
|
wg_notify
|
||||||
|
else
|
||||||
|
yad --text-align=center --button=$"OK" --title=$"Wireguard .conf Select file" \
|
||||||
|
--image-on-top --image=${wg_pic}wg-info.png \
|
||||||
|
--fixed --center --buttons-layout=center --borders=8 \
|
||||||
|
--text $"<b>Oh da ging etwas schief!</b> \n
|
||||||
|
<b>Keine gültige Wireguard Datei.</b> \n
|
||||||
|
<b>Hier ein Beispiel:</b><span color='#0fad0a'><b>my_wireguard.conf</b></span> \n"
|
||||||
|
import_wg
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
fi }
|
fi }
|
||||||
export -f import_wg
|
export -f import_wg
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user