From 5ed1d832c7289459990f29178b5de08c4f5a56c1 Mon Sep 17 00:00:00 2001 From: punix Date: Mon, 20 Nov 2023 16:59:50 +0100 Subject: [PATCH] wg_notify and wire_g about new edit to start tun. --- wg_on_start | 19 ------------------ wire_g | 56 +++++++++++++++++++++++++++++++++-------------------- 2 files changed, 35 insertions(+), 40 deletions(-) diff --git a/wg_on_start b/wg_on_start index aeb2af4..3e59441 100644 --- a/wg_on_start +++ b/wg_on_start @@ -44,25 +44,6 @@ ACTIVE=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ # autoconnect wird hier abgeschalten damit auch neu importierte nach einem Systemneustart nicht aktiv sind IFS=$'\n' lines=( $(cat ${WG_WDIR}tunnel.txt) ) nmcli con mod "$lines" connection.autoconnect no - - if [ -d /home/$USER/.config/autostart ] # for GNOME, XFCE, KDE, Budgie - then - if grep 'TRUE TRUE\|TRUE FALSE' ${WG_WDIR}about.txt - then - cp /home/"$USER"/.local/share/wg_nmcli/wgonstart.desktop /home/"$USER"/.config/autostart/ - else - rm /home/"$USER"/.config/autostart/wgonstart.desktop - fi - - elif [ -d /home/$USER/.config/lxsession/Lubuntu/autostart ] # for LXDE - then - if grep 'TRUE TRUE\|TRUE FALSE' ${WG_WDIR}about.txt - then - cp /home/"$USER"/.local/share/wg_nmcli/wgonstart.desktop /home/$USER/.config/lxsession/Lubuntu/autostart/ - else - rm /home/$USER/.config/lxsession/Lubuntu/autostart/wgonstart.desktop - fi - fi yad --notification \ --image="${WG_PIC}wg-vpn.png" \ diff --git a/wire_g b/wire_g index 90731a0..95d2a2e 100755 --- a/wire_g +++ b/wire_g @@ -55,25 +55,6 @@ wg_notify(){ IFS=$'\n' lines=( $(cat ${WG_WDIR}tunnel.txt) ) nmcli con mod "$lines" connection.autoconnect no - if [ -d /home/$USER/.config/autostart ] # for GNOME, XFCE, KDE, Budgie - then - if grep 'TRUE TRUE\|TRUE FALSE' ${WG_WDIR}about.txt - then - cp /home/"$USER"/.local/share/wg_nmcli/wgonstart.desktop /home/"$USER"/.config/autostart/ - else - rm /home/"$USER"/.config/autostart/wgonstart.desktop - fi - - elif [ -d /home/$USER/.config/lxsession/Lubuntu/autostart ] # for LXDE - then - if grep 'TRUE TRUE\|TRUE FALSE' ${WG_WDIR}about.txt - then - cp /home/"$USER"/.local/share/wg_nmcli/wgonstart.desktop /home/$USER/.config/lxsession/Lubuntu/autostart/ - else - rm /home/$USER/.config/lxsession/Lubuntu/autostart/wgonstart.desktop - fi - fi - yad --notification \ --image="${WG_PIC}wg-vpn.png" \ --icon-size=32 --no-middle \ @@ -193,11 +174,36 @@ up_or_down(){ # funktion end ############################################################################################################ -############################################################################################################ +############################################################################################################ +#for about of select Autostart + +on_start(){ + +if [ -d /home/$USER/.config/autostart ] # for GNOME, XFCE, KDE, Budgie + then + if grep 'TRUE TRUE\|TRUE FALSE' ${WG_WDIR}about.txt + then + cp /home/"$USER"/.local/share/wg_nmcli/wgonstart.desktop /home/"$USER"/.config/autostart/ + else + rm /home/"$USER"/.config/autostart/wgonstart.desktop + fi + + elif [ -d /home/$USER/.config/lxsession/Lubuntu/autostart ] # for LXDE + then + if grep 'TRUE TRUE\|TRUE FALSE' ${WG_WDIR}about.txt + then + cp /home/"$USER"/.local/share/wg_nmcli/wgonstart.desktop /home/$USER/.config/lxsession/Lubuntu/autostart/ + else + rm /home/$USER/.config/lxsession/Lubuntu/autostart/wgonstart.desktop + fi + fi +} + + # function button "about" about(){ - + if grep 'TRUE TRUE' ${WG_WDIR}about.txt then yad --form --fixed \ @@ -214,6 +220,8 @@ about(){ Use without warranty. \n Download Wire-G \n" &> ${WG_WDIR}about.txt + on_start + elif grep 'FALSE TRUE' ${WG_WDIR}about.txt then yad --form --fixed \ @@ -230,6 +238,8 @@ about(){ Use without warranty. \n Download Wire-G \n" &> ${WG_WDIR}about.txt + on_start + elif grep 'FALSE FALSE' ${WG_WDIR}about.txt then yad --form --fixed \ @@ -246,6 +256,8 @@ about(){ Use without warranty. \n Download Wire-G \n" &> ${WG_WDIR}about.txt + on_start + elif grep 'TRUE FALSE' ${WG_WDIR}about.txt then yad --form --fixed \ @@ -262,6 +274,8 @@ about(){ Use without warranty. \n Download Wire-G \n" &> ${WG_WDIR}about.txt + on_start + fi }