From 67c63633b20ee3b483bbfda9fc7fedb73637ee72 Mon Sep 17 00:00:00 2001 From: punix Date: Tue, 14 Nov 2023 12:44:31 +0100 Subject: [PATCH] remove 6 test --- wire_g | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/wire_g b/wire_g index d9e45c9..635cf10 100755 --- a/wire_g +++ b/wire_g @@ -115,22 +115,10 @@ export -f import_wg # funktion wireguard remove remove(){ - a_user=$(whoami) - wg_pic="/home/$a_user/.icons/" - wg_wdir="/home/$a_user/.config/wg_nmcli/" - tunnel=$(nmcli connection show | grep -iPo "(.*)(wireguard)" | sed 's/ .*//') + nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//' &> ${wg_wdir}.wg_noactive.txt active=$(cat ${wg_wdir}.wg_noactive.txt) - if selection=$(yad --no-click --list --center \ - --window-icon=${wg_pic}wg-trash.png \ - --height=200 --width=60 --undecorated \ - --buttons-layout=center --separator="" \ - --button=$"OK" --button=$"Cancel" \ - --borders=8 \ - --column=$"Delete" $tunnel) - - then nmcli connection delete $selection &> ${wg_wdir}.tmp.txt if success=$(grep -i 'erfolgreich gelöscht\|successfully deleted' ${wg_wdir}.tmp.txt) then @@ -151,8 +139,7 @@ remove(){ if [ "$selection" = "$active" ] then pkill yad - fi - fi } + fi } # function end