made VPN continuous
This commit is contained in:
parent
13994fa458
commit
546e9fdd56
@ -12,14 +12,17 @@ if ! command -v mullvad &>/dev/null ; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# getting vpn status
|
# reading vpn status as continous output
|
||||||
VPN_DISCONNECTED=$(mullvad status | grep Disconnected)
|
while read VPN_STATUS; do
|
||||||
|
|
||||||
if [[ -n "$VPN_DISCONNECTED" ]] ; then
|
VPN_DISCONNECTED=$(echo "$VPN_STATUS" | grep Disconnect);
|
||||||
# vpn is disconnected
|
|
||||||
echo "$DISCONNECTED"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# connected
|
if [[ -n "$VPN_DISCONNECTED" ]] ; then
|
||||||
echo "$CONNECTED"
|
# vpn is disconnected
|
||||||
|
echo "$DISCONNECTED"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
# connected
|
||||||
|
echo "$CONNECTED"
|
||||||
|
done < <(mullvad status listen)
|
||||||
|
@ -307,7 +307,7 @@ exec = printf "%s %s\n" `echo -e '\ueb29'` `pacman -Qu | wc -l`
|
|||||||
; custom vpn script
|
; custom vpn script
|
||||||
type = custom/script
|
type = custom/script
|
||||||
exec = vpn_status.sh
|
exec = vpn_status.sh
|
||||||
interval = 30
|
tail = true
|
||||||
|
|
||||||
[settings]
|
[settings]
|
||||||
screenchange-reload = true
|
screenchange-reload = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user