From 363894584d79b6e0ee8ebb970526d4978b838b24 Mon Sep 17 00:00:00 2001 From: punix Date: Fri, 10 Nov 2023 20:48:17 +0100 Subject: [PATCH] =?UTF-8?q?test=20mit=20export=20f=C3=BCr=20entfernen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wire_g | 33 ++++++++------------------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/wire_g b/wire_g index c35f265..94dd496 100755 --- a/wire_g +++ b/wire_g @@ -113,10 +113,8 @@ import_wg(){ No valid Wireguard file. \n Here is an example: my_wireguard.conf \n" import_wg ;; - esac -fi - -} + esac + fi } export -f import_wg # function end @@ -132,19 +130,6 @@ 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=300 --width=60 --title="Wire-G Trash" \ - --buttons-layout=center --separator="" \ - --button=$"OK" --button=$"Cancel" \ - --borders=8 --image-on-top --image=${wg_pic}wg-active.png \ - --column=$"Delete" $tunnel \ - --text=$"Activ Tunnel: $active ----------------------------------------------------------------------------------- -If no tunnels are listed, -so they have to import their tunnel beforehand.") - - then nmcli connection delete $selection &> ${wg_wdir}.tmp.txt if success=$(grep -i 'erfolgreich gelöscht\|successfully deleted' ${wg_wdir}.tmp.txt) then @@ -164,8 +149,7 @@ remove(){ then pkill wire_g pkill yad - fi - fi } + fi } export -f remove # function end @@ -231,12 +215,12 @@ connect(){ ############################################################################################################ # --text "Aktiver Tunnel: $active # mit gewünschtes wort wird fett geschrieben. # Farbe für Variable $active festgelegt mit fetter Schrift. (bei --text zwischen " ") -if selection=$(yad --no-click --list \ - --center \ +if selection=$(yad --list --center \ --height=300 --width=60 --title="Wire-G" \ --buttons-layout=center \ - --button=$"Start:0" --button=$"Stop":"bash -c up_or_down" \ - --button=$"Import":"bash -c import_wg" --button=$"Remove":"bash -c remove" --separator="" \ + --button=$"OK" --button=$"Stop":"bash -c up_or_down" \ + --button=$"Import":"bash -c import_wg" \ + --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 \ @@ -245,9 +229,8 @@ if selection=$(yad --no-click --list \ ---------------------------------------------------------------------------------- If no tunnels are listed, so they have to import their tunnel beforehand.") - +export selection then - if [[ -n $active ]] then wg_stop