blob: a578438a059f7236ba2d73116fed4074243d8a94 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
#!/bin/bash
INSTANCE="${BLOCK_INSTANCE:-}"
# Check VPN status
GET_VPN=$(ip route get 4.2.2.1 | grep -E -- "tun0|wg0|$INSTANCE" | awk '{ print $3 }')
# Store status
case $GET_VPN in
tun0|wg0|$INSTANCE) echo -e "<span color='#00FF00'>ON</span>\n";;
*) echo -e "<span color='#FFDD00'>OFF</span>\n";;
esac
|