vpn: change if to case
This commit is contained in:
parent
8ca8321f56
commit
5b22ce6b99
@ -3,12 +3,10 @@
|
|||||||
INSTANCE="${BLOCK_INSTANCE:-}"
|
INSTANCE="${BLOCK_INSTANCE:-}"
|
||||||
|
|
||||||
# Check VPN status
|
# Check VPN status
|
||||||
GET_VPN=$(ip route | grep -E -- "tun0|$INSTANCE" | awk '{ print $3 }')
|
GET_VPN=$(ip route | grep -E -- "tun0|wg0|$INSTANCE" | awk '{ print $3 }')
|
||||||
|
|
||||||
# Store status
|
# Store status
|
||||||
if [[ $GET_VPN == *"tun0"* || $GET_VPN == "$INSTANCE" ]]
|
case $GET_VPN in
|
||||||
then
|
tun0|wg0|$INSTANCE) echo -e "<span color='#00FF00'>ON</span>\n";;
|
||||||
echo -e "<span color='#00FF00'>ON</span>\n"
|
*) echo -e "<span color='#FFDD00'>OFF</span>\n";;
|
||||||
else
|
esac
|
||||||
echo -e "<span color='#FFDD00'>OFF</span>\n"
|
|
||||||
fi
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user