autoconnect geändert
This commit is contained in:
parent
035179c808
commit
a32cd0560a
@ -41,10 +41,6 @@ ACTIVE=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/
|
|||||||
--timeout 1 \
|
--timeout 1 \
|
||||||
--text=$"<span color='#0fad0a'><b>$ACTIVE</b></span> <span><b>powered</b></span>"
|
--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 \
|
yad --notification \
|
||||||
--image="${WG_PIC}wg-vpn.png" \
|
--image="${WG_PIC}wg-vpn.png" \
|
||||||
--icon-size=32 --no-middle \
|
--icon-size=32 --no-middle \
|
||||||
|
7
wire_g
7
wire_g
@ -37,7 +37,7 @@ ACTIVE=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/
|
|||||||
############################################################################################################
|
############################################################################################################
|
||||||
|
|
||||||
wg_notify(){
|
wg_notify(){
|
||||||
sleep 2
|
sleep 1
|
||||||
nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//' &> ${WG_WDIR}onstart.txt
|
nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//' &> ${WG_WDIR}onstart.txt
|
||||||
ACTIVE=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//')
|
ACTIVE=$(nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//')
|
||||||
case $LANG in
|
case $LANG in
|
||||||
@ -51,9 +51,6 @@ wg_notify(){
|
|||||||
--text-align=center --no-buttons --auto-close \
|
--text-align=center --no-buttons --auto-close \
|
||||||
--timeout 1 \
|
--timeout 1 \
|
||||||
--text=$"<span color='#0fad0a'><b>$ACTIVE</b></span> <span><b>powered</b></span>"
|
--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 \
|
yad --notification \
|
||||||
--image="${WG_PIC}wg-vpn.png" \
|
--image="${WG_PIC}wg-vpn.png" \
|
||||||
@ -102,10 +99,12 @@ import_wg(){
|
|||||||
then
|
then
|
||||||
wg_stop
|
wg_stop
|
||||||
nmcli connection import type wireguard file $WG_CONF &> ${WG_WDIR}.tmp.txt
|
nmcli connection import type wireguard file $WG_CONF &> ${WG_WDIR}.tmp.txt
|
||||||
|
nmcli con mod "$WG_CONF" connection.autoconnect no
|
||||||
wg_notify
|
wg_notify
|
||||||
else
|
else
|
||||||
kill $lines
|
kill $lines
|
||||||
nmcli connection import type wireguard file $WG_CONF &> ${WG_WDIR}.tmp.txt
|
nmcli connection import type wireguard file $WG_CONF &> ${WG_WDIR}.tmp.txt
|
||||||
|
nmcli con mod "$WG_CONF" connection.autoconnect no
|
||||||
wg_notify
|
wg_notify
|
||||||
fi
|
fi
|
||||||
nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//' &> ${WG_WDIR}onstart.txt
|
nmcli connection show --active | grep -iPo "(.*)(wireguard)" | sed 's/ .*//' &> ${WG_WDIR}onstart.txt
|
||||||
|
Loading…
x
Reference in New Issue
Block a user