Dateien nach "/" hochladen
This commit is contained in:
29
wg_stop
Normal file
29
wg_stop
Normal file
@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
############################################################################################################
|
||||
############################################################################################################
|
||||
|
||||
a_user=$(whoami)
|
||||
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) )
|
||||
#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
|
||||
disable=$(grep -i "deaktiviert" ${wg_wdir}.stop.txt)
|
||||
if [ "$?" = "0" ]
|
||||
then
|
||||
notify-send --icon=${wg_pic}wg-stop.png "$wert Verbindung wurde getrennt."
|
||||
pkill yad
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
################################# ENDE #################################################################
|
||||
############################################################################################################
|
||||
|
Reference in New Issue
Block a user