vpn: change if to case
This commit is contained in:
parent
8ca8321f56
commit
5b22ce6b99
@ -3,12 +3,10 @@
|
||||
INSTANCE="${BLOCK_INSTANCE:-}"
|
||||
|
||||
# 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
|
||||
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
|
||||
case $GET_VPN in
|
||||
tun0|wg0|$INSTANCE) echo -e "<span color='#00FF00'>ON</span>\n";;
|
||||
*) echo -e "<span color='#FFDD00'>OFF</span>\n";;
|
||||
esac
|
||||
|
Loading…
x
Reference in New Issue
Block a user