Add support VPN for OpenVPN and WireGuard

This commit is contained in:
Jesús
2021-03-25 23:11:14 -05:00
parent d971de1367
commit be12a6b78c
2 changed files with 15 additions and 2 deletions

14
scripts/i3blocks/vpn Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/bash
INSTANCE="${BLOCK_INSTANCE:-}"
# Check VPN status
GET_VPN=$(route | grep -E -- "tun0|$INSTANCE" | awk '{ print $NF }')
# Store status
if [[ $GET_VPN == *"tun0"* || $GET_VPN == "$INSTANCE" ]]
then
echo -e "<span color='#00FF00'>ON</span>\n"
else
echo -e "<span color='#FFDD00'>OFF</span>\n"
fi