diff --git a/wire_g b/wire_g index 93534ad..25a2157 100755 --- a/wire_g +++ b/wire_g @@ -85,6 +85,17 @@ import_wg(){ --width=1200 --height=800 \ --window-icon=${wg_pic}wg-import.png \ --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 case "$wgconf" in @@ -97,7 +108,7 @@ import_wg(){ nmcli connection import type wireguard file $wgconf &> ${wg_wdir}.tmp.txt wg_notify - i else + else nmcli connection import type wireguard file $wgconf &> ${wg_wdir}.tmp.txt wg_notify