zurück zu translate
This commit is contained in:
8
wg_stop
8
wg_stop
@ -7,17 +7,17 @@
|
||||
wg_wdir="/home/$a_user/.config/wg_nmcli/"
|
||||
wg_pic="/home/$a_user/.icons/"
|
||||
#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")" )
|
||||
IFS=$'\n' lines=( "$(cat ${wg_wdir}.tunnel.txt)" )
|
||||
#echo ${lines[0]} #Damit wird der Inhalt ausgelesen. (Index angeben)
|
||||
wert=$"*_*"
|
||||
for wert in "${lines[@]}"
|
||||
do
|
||||
# rm /home/$a_user/.config/wg_nmcli/.tunnel.txt # falls Wireguard nicht richtig funktioniert hier die # wegnehmen
|
||||
# hier wird die Ausgabe von nmcli für die auswertung in die .stop.txt gespeichert
|
||||
nmcli connection down "$wert" &> "${wg_wdir}.stop.txt"
|
||||
if disable=$(grep -i '"deaktiviert"\|"disabled"' "${wg_wdir}.stop.txt")
|
||||
nmcli connection down $wert &> ${wg_wdir}.stop.txt
|
||||
if disable=$(grep -i 'deaktiviert\|disabled' ${wg_wdir}.stop.txt)
|
||||
then
|
||||
notify-send --icon="${wg_pic}wg-stop.png" "$wert Connection disconnected."
|
||||
notify-send --icon=${wg_pic}wg-stop.png "$wert Connection disconnected."
|
||||
pkill yad
|
||||
|
||||
fi
|
||||
|
Reference in New Issue
Block a user