Compare commits

..

25 Commits

Author SHA1 Message Date
b4acba5096 remove background update message 2023-11-29 21:57:04 +01:00
b097bb729a edit CHANGELOG 2023-11-29 21:53:16 +01:00
d5a6f7ef23 fix translate 2023-11-29 21:50:50 +01:00
c20f8edf2e message update on background 2023-11-29 21:44:09 +01:00
c450618f57 fix update messege skip-taskbar 2023-11-29 21:25:16 +01:00
43629f59c6 update translate and update to 3.2.0 2023-11-29 21:23:09 +01:00
a6dc353c7f new edit wg_start test text 2023-11-29 21:09:37 +01:00
f74c153b76 remove case to translate open in Notify 2023-11-29 20:44:53 +01:00
ff2119c7c7 fix autostart message 2023-11-29 20:37:19 +01:00
a5eeaaf727 fix if ping -c 1 git.lunix.dedyn.io 2023-11-29 20:33:07 +01:00
d97ffb4c33 fix on fi fail 2023-11-29 20:25:24 +01:00
4eecae9d60 fix on remove active tunnel 2023-11-29 19:40:28 +01:00
1bdbc9087f Update integrated 2023-11-29 12:25:36 +01:00
fd6cb7dd84 update aktiv edit 2023-11-29 12:17:31 +01:00
dd7c42bbc0 update to 3.1.9 2023-11-28 22:03:56 +01:00
642dd049eb part one for update 2023-11-28 21:59:09 +01:00
a8200bc943 add changelog 2023-11-28 18:45:06 +01:00
e6ac54a6de wg_version delete 2023-11-28 18:09:24 +01:00
abb33cae46 Version File add 2023-11-28 12:21:32 +01:00
87bdc70838 fix autoconnect no 2023-11-27 12:44:08 +01:00
0af5947234 autoconnect.no add to remove 2023-11-27 12:12:26 +01:00
07d5ab0145 autoconnect.no to import 2023-11-27 12:11:16 +01:00
a32cd0560a autoconnect geändert 2023-11-27 09:19:40 +01:00
035179c808 fix on wg_on_start 2023-11-26 19:38:24 +01:00
14c2a6c69a test 2023-11-26 17:50:32 +01:00
8 changed files with 190 additions and 104 deletions

View File

@ -20,18 +20,24 @@ if grep -i 'mint\|debian\|ubuntu\|pop|' /etc/os-release > /dev/null 2>&1
echo $"Wire-G is installed..."
mkdir -p /home/"$USER"/.icons ; cp icons/* /home/"$USER"/.icons/ ; mkdir -p /home/"$USER"/.config/wg_nmcli
if ! which yad &> /dev/null ; then sudo apt install yad -y &> /dev/null & echo yad is installed... ; fi
if ! which diff &> /dev/null ; then sudo apt install diff -y &> /dev/null ; fi
if ! which wget &> /dev/null ; then sudo apt install wget -y &> /dev/null ; fi
elif grep -i 'arch\|manjaro\|garuda\|endeavour|' /etc/os-release > /dev/null 2>&1
then
echo $"Wire-G is installed..."
mkdir -p /home/"$USER"/.icons ; cp icons/* /home/"$USER"/.icons/ ; mkdir -p /home/"$USER"/.config/wg_nmcli
if ! which yad &> /dev/null ; then sudo pacman -S --noconfirm yad &> /dev/null & echo yad is installed... ; fi
if ! which diff &> /dev/null ; then sudo pacman -S --noconfirm diff -y &> /dev/null ; fi
if ! which wget &> /dev/null ; then sudo pacman -S --noconfirm wget -y &> /dev/null ; fi
elif grep -i 'fedora' /etc/os-release > /dev/null 2>&1
then
echo $"Wire-G is installed..."
mkdir -p /home/"$USER"/.icons ; cp icons/* /home/"$USER"/.icons/ ; mkdir -p /home/"$USER"/.config/wg_nmcli
if ! which yad &> /dev/null ; then sudo dnf install yad -y ; fi
if ! which diff &> /dev/null ; then sudo dnf install diff -y &> /dev/null ; fi
if ! which wget &> /dev/null ; then sudo sudo dnf install wget -y &> /dev/null ; fi
elif grep -i 'suse' /etc/os-release > /dev/null 2>&1
then
@ -46,6 +52,8 @@ elif grep -i 'suse' /etc/os-release > /dev/null 2>&1
then
echo $"Wire-G is installed..."
mkdir -p /home/"$USER"/.icons ; cp icons/* /home/"$USER"/.icons/ ; mkdir -p /home/"$USER"/.config/wg_nmcli
if ! which diff &> /dev/null ; then sudo zypper install diff -y &> /dev/null ; fi
if ! which wget &> /dev/null ; then sudo zypper install wget -y &> /dev/null ; fi
else
exit 1

Binary file not shown.

View File

@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-11-24 17:50+0100\n"
"PO-Revision-Date: 2023-11-26 08:42+0100\n"
"POT-Creation-Date: 2023-11-29 21:10+0100\n"
"PO-Revision-Date: 2023-11-29 21:49+0100\n"
"Last-Translator: punix <polunga40@unity-mail.de>\n"
"Language-Team: German <translation-team-de@lists.sourceforge.net>\n"
"Language: de\n"
@ -18,18 +18,18 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.4\n"
#: /home/punix/VSCodium/Wire-G/wire_g:53
#: /home/punix/VSCodium/Wire-G/wire_g:48
msgid ""
"<span color='#0fad0a'><b>$ACTIVE</b></span> <span><b>powered</b></span>"
msgstr ""
"<span color='#0fad0a'><b>$ACTIVE</b></span> <span><b>eingeschaltet</b></"
"span>"
#: /home/punix/VSCodium/Wire-G/wire_g:61
#: /home/punix/VSCodium/Wire-G/wire_g:53
msgid "$ACTIVE activ"
msgstr "$ACTIVE aktiv"
#: /home/punix/VSCodium/Wire-G/wire_g:62
#: /home/punix/VSCodium/Wire-G/wire_g:54
msgid ""
"Wire-G open!/sbin/wire_g\n"
" |$ACTIVE stop!/sbin/wg_stop"
@ -37,19 +37,19 @@ msgstr ""
"Wire-G öffnen!/sbin/wire_g\n"
" |$ACTIVE stop!/sbin/wg_stop"
#: /home/punix/VSCodium/Wire-G/wire_g:79
#: /home/punix/VSCodium/Wire-G/wire_g:71
msgid "Cancel"
msgstr "Abbrechen"
#: /home/punix/VSCodium/Wire-G/wire_g:79
#: /home/punix/VSCodium/Wire-G/wire_g:71
msgid "Wireguard .conf Select file"
msgstr "Wireguard .conf Datei auswählen"
#: /home/punix/VSCodium/Wire-G/wire_g:89
#: /home/punix/VSCodium/Wire-G/wire_g:81
msgid "Tunnel already exists!"
msgstr "Tunnelname existiert schon!"
#: /home/punix/VSCodium/Wire-G/wire_g:117
#: /home/punix/VSCodium/Wire-G/wire_g:111
msgid ""
"<b>Oh, something went wrong. No valid Wireguard file. </b> \\n\n"
"<b>Here is an example:</b><span color='#0fad0a'><b> my_wireguard.conf</b></"
@ -59,7 +59,7 @@ msgstr ""
"<b>Hier ein beispiel:</b><span color='#0fad0a'><b> my_wireguard.conf</b></"
"span>"
#: /home/punix/VSCodium/Wire-G/wire_g:140
#: /home/punix/VSCodium/Wire-G/wire_g:134
msgid ""
"<span>Your Tunnel $SELECTION was successfully deleted.</span> \\n\n"
"<span>Attention! The autostart has been reset.</span> \\n\n"
@ -71,37 +71,48 @@ msgstr ""
"<span>Benötigen sie den Autostart für einen weiteren Tunnel,</span> \\n\n"
"<span>aktivieren sie den Autostart erneut.</span> \\n"
#: /home/punix/VSCodium/Wire-G/wire_g:138
#: /home/punix/VSCodium/Wire-G/wire_g:144
#: /home/punix/VSCodium/Wire-G/wire_g:150
msgid "OK"
msgstr "OK"
#: /home/punix/VSCodium/Wire-G/wire_g:149
#: /home/punix/VSCodium/Wire-G/wire_g:143
msgid "Oh something went wrong.\\nPlease delete Tunnel in the network manager."
msgstr "Oh etwas ging schief.\\nBitte Tunnel im Networkmanager löschen."
#: /home/punix/VSCodium/Wire-G/wire_g:181
#: /home/punix/VSCodium/Wire-G/wire_g:176
msgid "There is no active Tunnel that you could stop."
msgstr "Es gibt keinen aktiven Tunnel den man stoppen könnte."
#: /home/punix/VSCodium/Wire-G/wire_g:227
#: /home/punix/VSCodium/Wire-G/wire_g:245
#: /home/punix/VSCodium/Wire-G/wire_g:263
#: /home/punix/VSCodium/Wire-G/wire_g:281
#: /home/punix/VSCodium/Wire-G/wire_g:225
msgid ""
"<span>It's not a tunnel active. If you want to activate the autostart,</"
"span> \\n \n"
"<span>must be activated or imported before the next PC start.</span>\\n"
msgstr ""
"<span>Es ist kein Tunnel aktiv. Möchten Sie den Autostart aktivieren,</span> "
"\\n \n"
"<span>muss vor dem nächsten PC Start, ein Tunnel aktiviert oder importiert "
"werden.</span>\\n"
#: /home/punix/VSCodium/Wire-G/wire_g:234
#: /home/punix/VSCodium/Wire-G/wire_g:252
#: /home/punix/VSCodium/Wire-G/wire_g:270
#: /home/punix/VSCodium/Wire-G/wire_g:288
msgid "Autoconnect on PC Start:CHK"
msgstr "Bei PC Start Automatisch verbinden:CHK"
#: /home/punix/VSCodium/Wire-G/wire_g:228
#: /home/punix/VSCodium/Wire-G/wire_g:246
#: /home/punix/VSCodium/Wire-G/wire_g:264
#: /home/punix/VSCodium/Wire-G/wire_g:282
#: /home/punix/VSCodium/Wire-G/wire_g:235
#: /home/punix/VSCodium/Wire-G/wire_g:253
#: /home/punix/VSCodium/Wire-G/wire_g:271
#: /home/punix/VSCodium/Wire-G/wire_g:289
msgid "Search automatically for Wire-G updates:CHK"
msgstr "Suche Automatisch nach Wire-G updates:CHK"
#: /home/punix/VSCodium/Wire-G/wire_g:231
#: /home/punix/VSCodium/Wire-G/wire_g:249
#: /home/punix/VSCodium/Wire-G/wire_g:267
#: /home/punix/VSCodium/Wire-G/wire_g:285
#: /home/punix/VSCodium/Wire-G/wire_g:238
#: /home/punix/VSCodium/Wire-G/wire_g:256
#: /home/punix/VSCodium/Wire-G/wire_g:274
#: /home/punix/VSCodium/Wire-G/wire_g:292
msgid ""
"<span color='#626ff1'><b>Wire-G Author: Désiré Werner Menrath</b></span> "
"\\n \n"
@ -123,31 +134,39 @@ msgstr ""
"<a href='https://git.lunix.dedyn.io/punix/Wire-G/releases'>Download Wire-G </"
"a> \\n"
#: /home/punix/VSCodium/Wire-G/wire_g:325
#: /home/punix/VSCodium/Wire-G/wire_g:341
msgid ""
"<span>Update for Wireg-G is available.</span> \\n \n"
"<a href='https://git.lunix.dedyn.io/punix/Wire-G'>Download Wire-G </a> \\n"
msgstr ""
"<span>Update für Wireg-G ist verfügbar.</span> \\n \n"
"<a href='https://git.lunix.dedyn.io/punix/Wire-G'>Download Wire-G </a> \\n"
#: /home/punix/VSCodium/Wire-G/wire_g:346
msgid "Start:0"
msgstr "Start:0"
#: /home/punix/VSCodium/Wire-G/wire_g:325
#: /home/punix/VSCodium/Wire-G/wire_g:346
msgid "Stop:2"
msgstr "Stop:2"
#: /home/punix/VSCodium/Wire-G/wire_g:325
#: /home/punix/VSCodium/Wire-G/wire_g:346
msgid "Import:3"
msgstr "Importieren:3"
#: /home/punix/VSCodium/Wire-G/wire_g:325
#: /home/punix/VSCodium/Wire-G/wire_g:346
msgid "Remove:4"
msgstr "Entfernen:4"
#: /home/punix/VSCodium/Wire-G/wire_g:325
#: /home/punix/VSCodium/Wire-G/wire_g:346
msgid "About:5"
msgstr "Über:5"
#: /home/punix/VSCodium/Wire-G/wire_g:325
#: /home/punix/VSCodium/Wire-G/wire_g:346
msgid "Selection"
msgstr "Auswahl"
#: /home/punix/VSCodium/Wire-G/wire_g:325
#: /home/punix/VSCodium/Wire-G/wire_g:346
msgid ""
"<b>Activ Tunnel: </b> <span color='#0fad0a'><b>$ACTIVE</b></span> \n"
"<b>-----------------------------------------------------------------------------------------------------"
@ -158,12 +177,12 @@ msgstr ""
"<b>Aktiver Tunnel: </b> <span color='#0fad0a'><b>$ACTIVE</b></span> \n"
"<b>-----------------------------------------------------------------------------------------------------"
"</b> \n"
"<b>Sollten keine Tunnel aufgelistet sein,</b> \n"
"<b>müssen sie ihren Tunnel zuvor importieren.</b>"
"<b>Sollten hier keine Tunnel aufgelistet sein,</b> \n"
"<b>müssen Sie ihren Tunnel zuvor importieren.</b>"
#: /home/punix/VSCodium/Wire-G/wg_stop:40
msgid ""
"<span color='#0fad0a'><b>$VALUE </b></span><span> <b>disconnected</b></"
"span>"
msgstr ""
"<span color='#0fad0a'><b>$VALUE </b></span><span> <b>getrennt</b></span>"
"<span color='#0fad0a'><b>$VALUE</b></span> <span><b>getrennt</b></span>"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-11-24 17:50+0100\n"
"POT-Creation-Date: 2023-11-29 21:10+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -17,41 +17,41 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: /home/punix/VSCodium/Wire-G/wire_g:53
#: /home/punix/VSCodium/Wire-G/wire_g:48
msgid ""
"<span color='#0fad0a'><b>$ACTIVE</b></span> <span><b>powered</b></span>"
msgstr ""
#: /home/punix/VSCodium/Wire-G/wire_g:61
#: /home/punix/VSCodium/Wire-G/wire_g:53
msgid "$ACTIVE activ"
msgstr ""
#: /home/punix/VSCodium/Wire-G/wire_g:62
#: /home/punix/VSCodium/Wire-G/wire_g:54
msgid ""
"Wire-G open!/sbin/wire_g\n"
" |$ACTIVE stop!/sbin/wg_stop"
msgstr ""
#: /home/punix/VSCodium/Wire-G/wire_g:79
#: /home/punix/VSCodium/Wire-G/wire_g:71
msgid "Cancel"
msgstr ""
#: /home/punix/VSCodium/Wire-G/wire_g:79
#: /home/punix/VSCodium/Wire-G/wire_g:71
msgid "Wireguard .conf Select file"
msgstr ""
#: /home/punix/VSCodium/Wire-G/wire_g:89
#: /home/punix/VSCodium/Wire-G/wire_g:81
msgid "Tunnel already exists!"
msgstr ""
#: /home/punix/VSCodium/Wire-G/wire_g:117
#: /home/punix/VSCodium/Wire-G/wire_g:111
msgid ""
"<b>Oh, something went wrong. No valid Wireguard file. </b> \\n\n"
"<b>Here is an example:</b><span color='#0fad0a'><b> my_wireguard.conf</b></"
"span>"
msgstr ""
#: /home/punix/VSCodium/Wire-G/wire_g:140
#: /home/punix/VSCodium/Wire-G/wire_g:134
msgid ""
"<span>Your Tunnel $SELECTION was successfully deleted.</span> \\n\n"
"<span>Attention! The autostart has been reset.</span> \\n\n"
@ -59,37 +59,44 @@ msgid ""
"<span>please activate it again.</span> \\n"
msgstr ""
#: /home/punix/VSCodium/Wire-G/wire_g:138
#: /home/punix/VSCodium/Wire-G/wire_g:144
#: /home/punix/VSCodium/Wire-G/wire_g:150
msgid "OK"
msgstr ""
#: /home/punix/VSCodium/Wire-G/wire_g:149
#: /home/punix/VSCodium/Wire-G/wire_g:143
msgid "Oh something went wrong.\\nPlease delete Tunnel in the network manager."
msgstr ""
#: /home/punix/VSCodium/Wire-G/wire_g:181
#: /home/punix/VSCodium/Wire-G/wire_g:176
msgid "There is no active Tunnel that you could stop."
msgstr ""
#: /home/punix/VSCodium/Wire-G/wire_g:227
#: /home/punix/VSCodium/Wire-G/wire_g:245
#: /home/punix/VSCodium/Wire-G/wire_g:263
#: /home/punix/VSCodium/Wire-G/wire_g:281
#: /home/punix/VSCodium/Wire-G/wire_g:225
msgid ""
"<span>It's not a tunnel active. If you want to activate the autostart,</"
"span> \\n \n"
"<span>must be activated or imported before the next PC start.</span>\\n"
msgstr ""
#: /home/punix/VSCodium/Wire-G/wire_g:234
#: /home/punix/VSCodium/Wire-G/wire_g:252
#: /home/punix/VSCodium/Wire-G/wire_g:270
#: /home/punix/VSCodium/Wire-G/wire_g:288
msgid "Autoconnect on PC Start:CHK"
msgstr ""
#: /home/punix/VSCodium/Wire-G/wire_g:228
#: /home/punix/VSCodium/Wire-G/wire_g:246
#: /home/punix/VSCodium/Wire-G/wire_g:264
#: /home/punix/VSCodium/Wire-G/wire_g:282
#: /home/punix/VSCodium/Wire-G/wire_g:235
#: /home/punix/VSCodium/Wire-G/wire_g:253
#: /home/punix/VSCodium/Wire-G/wire_g:271
#: /home/punix/VSCodium/Wire-G/wire_g:289
msgid "Search automatically for Wire-G updates:CHK"
msgstr ""
#: /home/punix/VSCodium/Wire-G/wire_g:231
#: /home/punix/VSCodium/Wire-G/wire_g:249
#: /home/punix/VSCodium/Wire-G/wire_g:267
#: /home/punix/VSCodium/Wire-G/wire_g:285
#: /home/punix/VSCodium/Wire-G/wire_g:238
#: /home/punix/VSCodium/Wire-G/wire_g:256
#: /home/punix/VSCodium/Wire-G/wire_g:274
#: /home/punix/VSCodium/Wire-G/wire_g:292
msgid ""
"<span color='#626ff1'><b>Wire-G Author: Désiré Werner Menrath</b></span> "
"\\n \n"
@ -102,31 +109,37 @@ msgid ""
"a> \\n"
msgstr ""
#: /home/punix/VSCodium/Wire-G/wire_g:325
#: /home/punix/VSCodium/Wire-G/wire_g:341
msgid ""
"<span>Update for Wireg-G is available.</span> \\n \n"
"<a href='https://git.lunix.dedyn.io/punix/Wire-G'>Download Wire-G </a> \\n"
msgstr ""
#: /home/punix/VSCodium/Wire-G/wire_g:346
msgid "Start:0"
msgstr ""
#: /home/punix/VSCodium/Wire-G/wire_g:325
#: /home/punix/VSCodium/Wire-G/wire_g:346
msgid "Stop:2"
msgstr ""
#: /home/punix/VSCodium/Wire-G/wire_g:325
#: /home/punix/VSCodium/Wire-G/wire_g:346
msgid "Import:3"
msgstr ""
#: /home/punix/VSCodium/Wire-G/wire_g:325
#: /home/punix/VSCodium/Wire-G/wire_g:346
msgid "Remove:4"
msgstr ""
#: /home/punix/VSCodium/Wire-G/wire_g:325
#: /home/punix/VSCodium/Wire-G/wire_g:346
msgid "About:5"
msgstr ""
#: /home/punix/VSCodium/Wire-G/wire_g:325
#: /home/punix/VSCodium/Wire-G/wire_g:346
msgid "Selection"
msgstr ""
#: /home/punix/VSCodium/Wire-G/wire_g:325
#: /home/punix/VSCodium/Wire-G/wire_g:346
msgid ""
"<b>Activ Tunnel: </b> <span color='#0fad0a'><b>$ACTIVE</b></span> \n"
"<b>-----------------------------------------------------------------------------------------------------"

34
wg_nmcli/CHANGELOG Normal file
View File

@ -0,0 +1,34 @@
########################################################
########################################################
# Wire-G App for simple management a Wireguard TUNNEL ##
# Author: Désiré Werner Menrath ##
# Email: polunga40@unity-mail.de ##
# Translate German to English with LibreTranslate ##
# Translatefiles edit with Poedit ##
# Use without warranty! ##
########################################################
########################################################
--------------------------------------------------------
-29.11.2023-
[3.2.0]
fix on start when active Tunnel removed
new messeage window when active tunnel removed
update translate
new message on background
--------------------------------------------------------
-29.11.2023-
[3.1.9]
Update integrated
--------------------------------------------------------
-28.11.2023-
[3.1.9]
add wget and diff on install for update a Wire-G
--------------------------------------------------------
-27.11.2023-
[3.1.9]
New translate to German
autoconnect remove on Notify and add to
import Funktion
add this changlog to Wire-G
--------------------------------------------------------

View File

@ -28,22 +28,12 @@ IFS=$'\n' WG_START=( $(cat ${WG_WDIR}onstart.txt) )
nmcli connection up "$WG_START"
nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//' &> ${WG_WDIR}onstart.txt
ACTIVE=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//')
# case $LANG in
#
# de_DE.UTF-8) OPEN=öffnen ;;
#
# *) OPEN=open ;;
# esac
yad --image-on-top --image=${WG_PIC}wg-vpn-info.png \
--undecorated --borders=8 --skip-taskbar \
--text-align=center --no-buttons --auto-close \
--timeout 1 \
--text=$"<span color='#0fad0a'><b>"$ACTIVE"</b></span> <span><b>powered</b></span>"
# 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
yad --image-on-top --image=${WG_PIC}wg-vpn-info.png \
--undecorated --borders=8 --skip-taskbar \
--text-align=center --no-buttons --auto-close \
--timeout 1 \
--text=$"<span color='#0fad0a'><b>$ACTIVE</b></span> <span><b>powered</b></span>"
yad --notification \
--image="${WG_PIC}wg-vpn.png" \

View File

@ -41,4 +41,5 @@ WG_PIC="/home/$USER/.icons/"
fi
done
IFS=$'\n' lines=( $(cat ${WG_WDIR}for-kill_pid.txt) )
kill $lines
kill $lines
#test

63
wire_g
View File

@ -19,7 +19,7 @@ export TEXTDOMAINDIR="/usr/share/locale"
############################################################################################################
############################################################################################################
VERSION=3.1.9
VERSION=3.2.0
# wg_workdir Arbeitsverzeichnis wg
WG_WDIR="/home/$USER/.config/wg_nmcli/"
# Pfad wg Icons
@ -37,23 +37,15 @@ ACTIVE=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/
############################################################################################################
wg_notify(){
sleep 2
sleep 1
nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//' &> ${WG_WDIR}onstart.txt
ACTIVE=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//')
case $LANG in
de_DE.UTF-8) OPEN=öffnen ;;
*) OPEN=open ;;
esac
yad --image-on-top --image=${WG_PIC}wg-vpn-info.png \
--undecorated --borders=8 --skip-taskbar \
--text-align=center --no-buttons --auto-close \
--timeout 1 \
--text=$"<span color='#0fad0a'><b>$ACTIVE</b></span> <span><b>powered</b></span>"
# 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
yad --notification \
--image="${WG_PIC}wg-vpn.png" \
@ -107,8 +99,10 @@ import_wg(){
kill $lines
nmcli connection import type wireguard file $WG_CONF &> ${WG_WDIR}.tmp.txt
wg_notify
fi
fi
nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//' &> ${WG_WDIR}onstart.txt
IFS=$'\n' WG_START=( $(cat ${WG_WDIR}onstart.txt) )
nmcli con mod "$WG_START" connection.autoconnect no
fi ;;
*) yad --image-on-top --image=${WG_PIC}wg-info.png --height=150 --width=240 \
@ -155,6 +149,7 @@ remove(){
then
IFS=$'\n' lines=( $(cat ${WG_WDIR}for-kill_pid.txt) )
kill $lines
echo > ${WG_WDIR}onstart.txt
fi
if grep 'TRUE TRUE' ${WG_WDIR}about.txt
then
@ -214,11 +209,23 @@ if [ -d /home/$USER/.config/autostart ] # for GNOME, XFCE, KDE, Budgie
fi
}
#function on_start end
# function button "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>It's not a tunnel active. If you want to activate the autostart,</span> \n
<span>must be activated or imported before the next PC start.</span>\n"
fi
if grep 'TRUE TRUE' ${WG_WDIR}about.txt
then
yad --form --fixed \
@ -310,18 +317,32 @@ connect(){
# function end
############################################################################################################
############################################################################################################ # --text "<b>Aktiver TUNNEL:</b> <span color='#0fad0a'><b>$ACTIVE</b></span> # mit <b>gewünschtes wort</b> wird fett geschrieben.
# Farbe für Variable $ACTIVE festgelegt mit fetter Schrift. (bei --text zwischen " ")
if [[ ! -d ${WG_WDIR} || ! -e ${WG_WDIR}about.txt ]]
then
mkdir -p /home/"$USER"/.config/wg_nmcli
echo FALSE TRUE > ${WG_WDIR}about.txt
fi
#Here is update of Wire-G for future
#if AUTOUPDATE=$(grep 'TRUE TRUE\|FALSE TRUE' ${WG_WDIR}about.txt)
# then
# here comms command to update Wire-G
#fi
#Search on Updates
if AUTOUPDATE=$(grep 'TRUE TRUE\|FALSE TRUE' ${WG_WDIR}about.txt)
then
rm /tmp/CHANGELOG &> /dev/null
wget https://git.lunix.dedyn.io/punix/Wire-G/raw/branch/main/wg_nmcli/CHANGELOG -P /tmp
UPDATE=$(diff -q /home/"$USER"/.local/share/wg_nmcli/CHANGELOG /tmp/CHANGELOG)
if [[ -n "$UPDATE" ]]
then
yad --form --fixed \
--borders=8 --buttons-layout=center --text-align=center \
--button="OK" --undecorated \
--image-on-top --image=${WG_PIC}wg-vpn-info.png \
--separator=" " --skip-taskbar \
--text=$"<span>Update for Wireg-G is available.</span> \n
<a href='https://git.lunix.dedyn.io/punix/Wire-G'>Download Wire-G </a> \n"
fi
fi
#Here is start Wire-G
SELECTION=$(yad --no-klick --list --center \
--height=300 --width=60 --title="Wire-G" \
--buttons-layout=center \