From 35373f4e4ee001a51c141f798f328ff003a16495 Mon Sep 17 00:00:00 2001 From: punix Date: Mon, 30 Oct 2023 18:03:45 +0100 Subject: [PATCH] =?UTF-8?q?Meldungsfenster=20f=C3=BCr=20Stop=20Button=20in?= =?UTF-8?q?=20Wire-G=20eingeb.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wg_stop | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wg_stop b/wg_stop index e55ac02..de19ed0 100755 --- a/wg_stop +++ b/wg_stop @@ -6,6 +6,14 @@ a_user=$(whoami) wg_wdir="/home/$a_user/.config/wg_nmcli/" wg_pic="/home/$a_user/.icons/" + active=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//') + if [ -z $active ] + then + yad --image-on-top --image=${wg_pic}wg-info.png \ + --text="Es gibt keinen aktiven Tunnel den man stoppen könnte.\n" \ + --text-align=center --button="OK" --title "Wire-G" \ + --fixed --center --buttons-layout=center --borders=8 --center + fi #Damit wird der inhalt von /home/$a_user/.config/wg_nmcli/.tunnel.txt in ein Array gespeichert IFS=$'\n' lines=( $(cat ${wg_wdir}.tunnel.txt) ) #echo ${lines[0]} #Damit wird der Inhalt ausgelesen. (Index angeben) @@ -20,6 +28,7 @@ then notify-send --icon=${wg_pic}wg-stop.png "$wert Verbindung wurde getrennt." pkill yad + fi done