From ea08fc954e53130539c92ea492ff05a5c6ebf3cf Mon Sep 17 00:00:00 2001 From: punix Date: Thu, 16 Nov 2023 20:34:33 +0100 Subject: [PATCH] test mit import doppelter tunnel --- wire_g | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/wire_g b/wire_g index ca7c488..5ea7ca0 100755 --- a/wire_g +++ b/wire_g @@ -81,8 +81,20 @@ import_wg(){ --width=1200 --height=800 --no-klick \ --window-icon=${WG_PIC}wg-import.png \ --title=$"Wireguard .conf Select file") - + then + IFS=$'\n' lines=( $(cat ${WG_WDIR}tunnel.txt) ) + #echo ${lines[0]} #Damit wird der Inhalt ausgelesen. (Index angeben) + for WG_CONF in "${lines[@]}" + do + yad --image-on-top --image=${WG_PIC}wg-info.png \ + --text=$"Tunnel already exists!" \ + --text-align=center --no-buttons \ + --borders=8 --undecorated \ + --timeout 3 --timeout-indicator=bottom --skip-taskbar + import_wg + done + else case "$WG_CONF" in *_*.conf) if grep -i 'PEER\|PublicKey' $WG_CONF > /dev/null && grep -i 'Interface\|PrivateKey' $WG_CONF > /dev/null @@ -149,8 +161,6 @@ remove(){ up_or_down(){ - WG_PIC="/home/$USER/.icons/" - ACTIVE=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//') if [[ -z $ACTIVE ]] then yad --image-on-top --image=${WG_PIC}wg-info.png \