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