15 lines
317 B
Bash
Executable File
15 lines
317 B
Bash
Executable File
#!/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
|