From 0a196f54e48fa876d15314de7fde98b33f4ce54a Mon Sep 17 00:00:00 2001 From: punix Date: Thu, 9 Nov 2023 16:53:37 +0100 Subject: [PATCH] =?UTF-8?q?pr=C3=BCfung=20ob=20Tunnel=20schon=20importiert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wire_g | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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