prüfung ob Tunnel schon importiert

This commit is contained in:
Désiré Werner Menrath 2023-11-09 16:53:37 +01:00
parent d09563d737
commit 0a196f54e4

13
wire_g
View File

@ -85,6 +85,17 @@ 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")
IFS=$'\n' lines=( $(cat ${wg_wdir}.tunnel.txt) )
for wgconf in "${lines[@]}"
do
yad --window-icon=${wg_pic}wg-stop.png \
--image=${wg_pic}wg-info.png --button "OK" \
--text "Tunnelname existiert schon." \
--text-align=center --title=$"Wireguard .conf Select file"
break
done
then then
case "$wgconf" in case "$wgconf" in
@ -97,7 +108,7 @@ import_wg(){
nmcli connection import type wireguard file $wgconf &> ${wg_wdir}.tmp.txt nmcli connection import type wireguard file $wgconf &> ${wg_wdir}.tmp.txt
wg_notify wg_notify
i else else
nmcli connection import type wireguard file $wgconf &> ${wg_wdir}.tmp.txt nmcli connection import type wireguard file $wgconf &> ${wg_wdir}.tmp.txt
wg_notify wg_notify