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)
active=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//')
wg_pic="/home/$a_user/.icons/"
pid=$(ps aux | grep yad | grep -v grep | awk '{print $2}')
case $LANG in
de_DE.UTF-8) open=öffnen ;;
@ -61,10 +60,6 @@ wg_notify(){
--menu="Wire-G $open!/sbin/wire_g
|$active stop!/sbin/wg_stop" \
--command="menu"
while [[ -z $active ]]
do
kill $pid
done
}
export -f wg_notify
@ -151,11 +146,12 @@ remove(){
--text-align=center --button=$"OK" --title "Wire-G Trash" \
--center --buttons-layout=center --borders=8
fi
# if [ "$selection" = "$active" ]
# then
# pkill wire_g
# kill yad
# fi
if [ "$selection" = "$active" ]
then
pkill wire_g
kill yad
wire_g
fi
fi }
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>
<b>----------------------------------------------------------------------------------</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
if [[ -n $active ]]
then
@ -243,11 +239,14 @@ if selection=$(yad --no-klick --list --center \
nmcli connection up $selection &> ${wg_wdir}.tmp.txt
connect
pid=$(ps aux | grep yad | grep -v grep | awk '{print $2}')
kill $pid
wire_g
else
nmcli connection up $selection &> ${wg_wdir}.tmp.txt
connect
pid=$(ps aux | grep yad | grep -v grep | awk '{print $2}')
kill $pid
wire_g
fi
fi