test 8 pid

This commit is contained in:
Désiré Werner Menrath 2023-11-11 19:21:03 +01:00
parent 458c488450
commit e354c1c04e

23
wire_g
View File

@ -42,7 +42,6 @@ wg_notify(){
a_user=$(whoami) a_user=$(whoami)
active=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//') active=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//')
wg_pic="/home/$a_user/.icons/" wg_pic="/home/$a_user/.icons/"
pid=$(ps aux | grep yad | grep -v grep | awk '{print $2}')
case $LANG in case $LANG in
de_DE.UTF-8) open=öffnen ;; de_DE.UTF-8) open=öffnen ;;
@ -61,10 +60,6 @@ wg_notify(){
--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"
while [[ -z $active ]]
do
kill $pid
done
} }
export -f wg_notify export -f wg_notify
@ -151,11 +146,12 @@ remove(){
--text-align=center --button=$"OK" --title "Wire-G Trash" \ --text-align=center --button=$"OK" --title "Wire-G Trash" \
--center --buttons-layout=center --borders=8 --center --buttons-layout=center --borders=8
fi fi
# if [ "$selection" = "$active" ] if [ "$selection" = "$active" ]
# then then
# pkill wire_g pkill wire_g
# kill yad kill yad
# fi wire_g
fi
fi } fi }
export -f remove export -f remove
@ -235,7 +231,7 @@ if selection=$(yad --no-klick --list --center \
--text=$"<b>Activ Tunnel: </b> <span color='#0fad0a'><b>$active</b></span> --text=$"<b>Activ Tunnel: </b> <span color='#0fad0a'><b>$active</b></span>
<b>----------------------------------------------------------------------------------</b> <b>----------------------------------------------------------------------------------</b>
<b>If no tunnels are listed,</b> <b>If no tunnels are listed,</b>
<b>so they have to import their tunnel beforehand.</b>") <b>so they have to import their tunnel beforehand.</b>") &
then then
if [[ -n $active ]] if [[ -n $active ]]
then then
@ -243,11 +239,14 @@ if selection=$(yad --no-klick --list --center \
nmcli connection up $selection &> ${wg_wdir}.tmp.txt nmcli connection up $selection &> ${wg_wdir}.tmp.txt
connect connect
pid=$(ps aux | grep yad | grep -v grep | awk '{print $2}') pid=$(ps aux | grep yad | grep -v grep | awk '{print $2}')
kill $pid
wire_g
else else
nmcli connection up $selection &> ${wg_wdir}.tmp.txt nmcli connection up $selection &> ${wg_wdir}.tmp.txt
connect connect
pid=$(ps aux | grep yad | grep -v grep | awk '{print $2}') pid=$(ps aux | grep yad | grep -v grep | awk '{print $2}')
kill $pid
wire_g
fi fi
fi fi