fix on remove active tunnel

This commit is contained in:
Désiré Werner Menrath 2023-11-29 19:40:28 +01:00
parent 1bdbc9087f
commit 4eecae9d60
2 changed files with 24 additions and 7 deletions

View File

@ -9,6 +9,10 @@
######################################################## ########################################################
######################################################## ########################################################
--------------------------------------------------------
-29.11.2023-
[3.1.9]
fix on start when active Tunnel removed
-------------------------------------------------------- --------------------------------------------------------
-29.11.2023- -29.11.2023-
[3.1.9] [3.1.9]

25
wire_g
View File

@ -135,7 +135,7 @@ remove(){
if SUCCESS=$(grep -i 'erfolgreich gelöscht\|successfully deleted' ${WG_WDIR}.tmp.txt) if SUCCESS=$(grep -i 'erfolgreich gelöscht\|successfully deleted' ${WG_WDIR}.tmp.txt)
then then
yad --window-icon=${WG_PIC}wg-trash.png --undecorated \ yad --window-icon=${WG_PIC}wg-trash.png --undecorated \
--image-on-top --image=${WG_PIC}wg-trash-info.png \ --image-on-top --image=${WG_PIC}wg-trasif ping -c 1 git.lunix.dedyn.ioh-info.png \
--text=$"<span>Your Tunnel $SELECTION was successfully deleted.</span> \n --text=$"<span>Your Tunnel $SELECTION was successfully deleted.</span> \n
<span>Attention! The autostart has been reset.</span> \n <span>Attention! The autostart has been reset.</span> \n
<span>If you need the autostart for another tunnel,</span> \n <span>If you need the autostart for another tunnel,</span> \n
@ -154,6 +154,7 @@ remove(){
then then
IFS=$'\n' lines=( $(cat ${WG_WDIR}for-kill_pid.txt) ) IFS=$'\n' lines=( $(cat ${WG_WDIR}for-kill_pid.txt) )
kill $lines kill $lines
echo > ${WG_WDIR}onstart.txt
fi fi
if grep 'TRUE TRUE' ${WG_WDIR}about.txt if grep 'TRUE TRUE' ${WG_WDIR}about.txt
then then
@ -188,7 +189,7 @@ up_or_down(){
# funktion end # funktion end
############################################################################################################ ############################################################################################################
############################################################################################################ ###########################################################if ping -c 1 git.lunix.dedyn.io#################################################
#for about of select Autostart #for about of select Autostart
on_start(){ on_start(){
@ -206,18 +207,30 @@ if [ -d /home/$USER/.config/autostart ] # for GNOME, XFCE, KDE, Budgie
then then
if grep 'TRUE TRUE\|TRUE FALSE' ${WG_WDIR}about.txt if grep 'TRUE TRUE\|TRUE FALSE' ${WG_WDIR}about.txt
then then
cp /home/"$USER"/.local/share/wg_nmcli/wgonstart.desktop /home/$USER/.config/lxsession/Lubuntu/autostart/ cp /home/"$USER"/.local/share/wg_nmif ping -c 1 git.lunix.dedyn.iocli/wgonstart.desktop /home/$USER/.config/lxsession/Lubuntu/autostart/
else else
rm /home/$USER/.config/lxsession/Lubuntu/autostart/wgonstart.desktop rm /home/$USER/.config/lxsession/Lubuntu/autostart/wgonstart.desktop
fi fi
fi fi
} }
#function on_start end
# function button "about" # function button "about"
about(){ about(){
IFS=$'\n' WG_START=( $(cat ${WG_WDIR}onstart.txt) )
if [[ -z "$WG_START" ]]
then
yad --form --fixed \
--borders=8 --buttons-layout=center --text-align=center \
--button="OK" --undecorated \
--image-on-top --image=${WG_PIC}wg-info.png \
--separator=" " \
--text=$"<span>If they activate the car start,</span> \n
<span>then they need to start a tunnnel so that the car start works correctly.</span>\n"
fi
if grep 'TRUE TRUE' ${WG_WDIR}about.txt if grep 'TRUE TRUE' ${WG_WDIR}about.txt
then then
yad --form --fixed \ yad --form --fixed \
@ -264,14 +277,14 @@ about(){
--image-on-top --image=${WG_PIC}wg-vpn-info.png \ --image-on-top --image=${WG_PIC}wg-vpn-info.png \
--separator=" " --window-icon=${WG_PIC}wg-vpn.png \ --separator=" " --window-icon=${WG_PIC}wg-vpn.png \
--text=$"<span color='#626ff1'><b>Wire-G Author: Désiré Werner Menrath</b></span> \n --text=$"<span color='#626ff1'><b>Wire-G Author: Désiré Werner Menrath</b></span> \n
<span color='#626ff1'><b>E-Mail: polunga40@unity-mail.de</b></span> \n <span color='#626ff1'><b>E-Mail: polunga40@unity-maif ping -c 1 git.lunix.dedyn.ioil.de</b></span> \n
<span color='#626ff1'><b>At all Tunnels, the auto start is disabled.</b></span> \n <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>Version: $VERSION </b></span> \n
<span color='#626ff1'><b>Use without warranty.</b></span> \n <span color='#626ff1'><b>Use without warranty.</b></span> \n
<a href='https://git.lunix.dedyn.io/punix/Wire-G/releases'>Download Wire-G </a> \n" &> ${WG_WDIR}about.txt <a href='https://git.lunix.dedyn.io/punix/Wire-G/releases'>Download Wire-G </a> \n" &> ${WG_WDIR}about.txt
on_start on_start
if ping -c 1 git.lunix.dedyn.io
elif grep 'TRUE FALSE' ${WG_WDIR}about.txt elif grep 'TRUE FALSE' ${WG_WDIR}about.txt
then then
yad --form --fixed \ yad --form --fixed \