From 2eb6b6adfc63a3aa09cf30e8e0ae0c479a81973f Mon Sep 17 00:00:00 2001 From: punix Date: Fri, 10 Nov 2023 22:20:33 +0100 Subject: [PATCH] neues remove Fenster --- .tmp.txt | 1 + wire_g | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 .tmp.txt diff --git a/.tmp.txt b/.tmp.txt new file mode 100644 index 0000000..d06462a --- /dev/null +++ b/.tmp.txt @@ -0,0 +1 @@ +Fehler: weder eine gültige Verbindung noch ein Gerät angegeben. diff --git a/wire_g b/wire_g index 07fb963..ebbe65a 100755 --- a/wire_g +++ b/wire_g @@ -130,6 +130,15 @@ remove(){ 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 @@ -149,9 +158,10 @@ remove(){ then pkill wire_g pkill yad - fi } + fi + fi } export -f remove - + # function end ############################################################################################################ ############################################################################################################ @@ -218,9 +228,9 @@ connect(){ if selection=$(yad --no-klick --list --center \ --height=300 --width=60 --title="Wire-G" \ --buttons-layout=center \ - --button=$"OK" --button=$"Stop":"bash -c up_or_down" \ + --button=$"Start:0" --button=$"Stop":"bash -c up_or_down" \ --button=$"Import":"bash -c import_wg" \ - --form --field=$"Remove:0""bash -c remove" --separator="" \ + --button=$"Remove":"bash -c remove" --separator="" \ --button=$"About":"bash -c about" \ --window-icon=${wg_pic}wg-vpn.png \ --borders=8 --image-on-top --image=${wg_pic}wg-active.png \ @@ -229,7 +239,6 @@ if selection=$(yad --no-klick --list --center \ ---------------------------------------------------------------------------------- If no tunnels are listed, so they have to import their tunnel beforehand.") -export selection then if [[ -n $active ]] then