tunnel doppelprüfung2

This commit is contained in:
Désiré Werner Menrath 2023-11-09 17:14:02 +01:00
parent 0a196f54e4
commit 1bb8963979

12
wire_g
View File

@ -86,6 +86,11 @@ import_wg(){
--window-icon=${wg_pic}wg-import.png \ --window-icon=${wg_pic}wg-import.png \
--title=$"Wireguard .conf Select file") --title=$"Wireguard .conf Select file")
then
case "$wgconf" in
*_*.conf) if grep -i 'PEER\|PublicKey' $wgconf > /dev/null && grep -i 'Interface\|PrivateKey' $wgconf > /dev/null
then
IFS=$'\n' lines=( $(cat ${wg_wdir}.tunnel.txt) ) IFS=$'\n' lines=( $(cat ${wg_wdir}.tunnel.txt) )
for wgconf in "${lines[@]}" for wgconf in "${lines[@]}"
do do
@ -94,13 +99,8 @@ import_wg(){
--text "Tunnelname existiert schon." \ --text "Tunnelname existiert schon." \
--text-align=center --title=$"Wireguard .conf Select file" --text-align=center --title=$"Wireguard .conf Select file"
break break
wire_g
done done
then
case "$wgconf" in
*_*.conf) if grep -i 'PEER\|PublicKey' $wgconf > /dev/null && grep -i 'Interface\|PrivateKey' $wgconf > /dev/null
then
active=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//') active=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//')
if [[ -n $active ]] if [[ -n $active ]]
then then