trst pid 16

This commit is contained in:
Désiré Werner Menrath 2023-11-11 21:02:41 +01:00
parent da7d4fe046
commit d97f4a2950

15
wire_g
View File

@ -91,10 +91,10 @@ import_wg(){
nmcli connection import type wireguard file $wgconf &> ${wg_wdir}.tmp.txt
wg_notify
else
pkill yad
nmcli connection import type wireguard file $wgconf &> ${wg_wdir}.tmp.txt
wg_notify
fi
kill -n $pid
wire_g
fi ;;
@ -146,7 +146,8 @@ remove(){
--text-align=center --button=$"OK" --title "Wire-G Trash" \
--center --buttons-layout=center --borders=8
fi
kill -n $pid
pkill yad
wg_notify
wire_g
if [ "$selection" = "$active" ]
then
@ -174,7 +175,6 @@ up_or_down(){
--center --buttons-layout=center --borders=8
else
wg_stop
kill -n $pid
wire_g
fi }
@ -189,7 +189,7 @@ about(){
a_user=$(whoami)
wg_pic="/home/$a_user/.icons/"
version=3.1.3
selection=$(yad --title="Wire-G" --center \
yad --title="Wire-G" --center \
--borders=8 --close-on-unfocus \
--buttons-layout=center --text-align=center \
--button=$"OK" --fixed \
@ -199,7 +199,7 @@ about(){
<span color='#626ff1'><b>At all tunnels, the auto start is disabled.</b></span> \n
<span color='#626ff1'><b>Version: $version </b></span> \n
<span color='#626ff1'><b>Use without warranty.</b></span> \n
<a href='https://git.lunix.dedyn.io/punix/Wire-G'>Download Wire-G </a> \n")
<a href='https://git.lunix.dedyn.io/punix/Wire-G'>Download Wire-G </a> \n"
}
export -f about
@ -213,6 +213,7 @@ connect(){
if success=$(grep -i 'erfolgreich aktiviert\|successfully activated' ${wg_wdir}.tmp.txt)
then
pkill yad
nmcli con mod $selection connection.autoconnect no
wg_notify
wire_g
@ -237,16 +238,18 @@ if selection=$(yad --no-klick --list --center \
<b>----------------------------------------------------------------------------------</b>
<b>If no tunnels are listed,</b>
<b>so they have to import their tunnel beforehand.</b>")
export pid=$(ps aux | grep yad | grep -v grep | awk '{print $2}')
then
if [[ -n $active ]]
then
wg_stop
nmcli connection up $selection &> ${wg_wdir}.tmp.txt
export pid=$(ps aux | grep yad | grep -v grep | awk '{print $2}')
connect
kill -n $pid
else
nmcli connection up $selection &> ${wg_wdir}.tmp.txt
export pid=$(ps aux | grep yad | grep -v grep | awk '{print $2}')
connect
kill -n $pid
fi