test mit kill

This commit is contained in:
Désiré Werner Menrath 2023-11-15 20:08:09 +01:00
parent bec2e44736
commit 9199ead91b
2 changed files with 7 additions and 5 deletions

View File

@ -30,7 +30,7 @@ export TEXTDOMAINDIR="/usr/share/locale"
VALUE=$"*_*" VALUE=$"*_*"
for VALUE in "${lines[@]}" for VALUE in "${lines[@]}"
do do
# hier wird die Ausgabe von nmcli für die ausVALUEung in die .stop.txt gespeichert # hier wird die Ausgabe von nmcli für die auswertung in die .stop.txt gespeichert
nmcli connection down "$VALUE" &> ${WG_WDIR}.stop.txt nmcli connection down "$VALUE" &> ${WG_WDIR}.stop.txt
if disable=$(grep -i 'deaktiviert\|deactivated' ${WG_WDIR}.stop.txt) if disable=$(grep -i 'deaktiviert\|deactivated' ${WG_WDIR}.stop.txt)
then then
@ -41,7 +41,8 @@ export TEXTDOMAINDIR="/usr/share/locale"
--text=$"<span color='#0fad0a'><b>"$VALUE" Connection disconnected</b></span>" --text=$"<span color='#0fad0a'><b>"$VALUE" Connection disconnected</b></span>"
fi fi
done done
pkill yad IFS=$'\n' lines=( $(cat ${WG_WDIR}Notify_PID.txt) )
kill $lines > /dev/null 2>&1
################################# END ################################################################## ################################# END ##################################################################
############################################################################################################ ############################################################################################################

5
wire_g
View File

@ -60,9 +60,10 @@ wg_notify(){
--text=$"$ACTIVE activ" \ --text=$"$ACTIVE activ" \
--menu="Wire-G $OPEN!/sbin/wire_g --menu="Wire-G $OPEN!/sbin/wire_g
|$ACTIVE stop!/sbin/wg_stop" \ |$ACTIVE stop!/sbin/wg_stop" \
--command="menu" --command="menu" &
# Schreib die pid von Notify in # Schreib die pid von Notify in
ps aux | grep yad | grep -v grep | awk '{print $2}' > ${WG_WDIR}Notify_PID.txt pid=$(ps aux | grep yad | grep -v grep | awk '{print $2}')
echo $pid > ${WG_WDIR}Notify_PID.txt
} }
export -f wg_notify export -f wg_notify