pid test 6
This commit is contained in:
parent
60abaa01ec
commit
5b0fc17c92
10
wire_g
10
wire_g
@ -42,6 +42,7 @@ 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 ;;
|
||||||
@ -148,7 +149,7 @@ remove(){
|
|||||||
if [ "$selection" = "$active" ]
|
if [ "$selection" = "$active" ]
|
||||||
then
|
then
|
||||||
pkill wire_g
|
pkill wire_g
|
||||||
pkill yad
|
kill "$pid"
|
||||||
fi
|
fi
|
||||||
fi }
|
fi }
|
||||||
export -f remove
|
export -f remove
|
||||||
@ -236,13 +237,12 @@ if selection=$(yad --no-klick --list --center \
|
|||||||
wg_stop
|
wg_stop
|
||||||
nmcli connection up $selection &> ${wg_wdir}.tmp.txt
|
nmcli connection up $selection &> ${wg_wdir}.tmp.txt
|
||||||
connect
|
connect
|
||||||
export pid=$(ps aux | grep yad | grep -v grep | awk '{print $2}')
|
pid=$(ps aux | grep yad | grep -v grep | awk '{print $2}')
|
||||||
bg $pid
|
|
||||||
else
|
else
|
||||||
nmcli connection up $selection &> ${wg_wdir}.tmp.txt
|
nmcli connection up $selection &> ${wg_wdir}.tmp.txt
|
||||||
connect
|
connect
|
||||||
export pid=$(ps aux | grep yad | grep -v grep | awk '{print $2}')
|
pid=$(ps aux | grep yad | grep -v grep | awk '{print $2}')
|
||||||
bg $pid
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user