funktion stop meldung hinzugefügt + fehler korrek.

This commit is contained in:
2023-11-01 09:54:42 +01:00
parent 536a8421af
commit 1b96bb46e3
2 changed files with 21 additions and 12 deletions

11
wg_stop
View File

@ -6,15 +6,6 @@
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="There is no active tunnel that you could stop.\n" \
--text-align=center --button="OK" --title "Wire-G" \
--fixed --center --buttons-layout=center --borders=8 --center
exit 0
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)
@ -27,7 +18,7 @@
disable=$(grep -i "deaktiviert" ${wg_wdir}.stop.txt)
if [ "$?" = "0" ]
then
notify-send --icon=${wg_pic}wg-stop.png "$wert Verbindung wurde getrennt."
notify-send --icon=${wg_pic}wg-stop.png "$wert Connection disconnected."
pkill yad
fi