test mit import doppelter tunnel

This commit is contained in:
Désiré Werner Menrath 2023-11-16 20:34:33 +01:00
parent 400c229bfc
commit ea08fc954e

14
wire_g
View File

@ -83,6 +83,18 @@ import_wg(){
--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 \