Use a REGEX to detect if the public IP is WISP network

This commit is contained in:
Keith Whyte 2021-09-15 21:35:54 +02:00
parent 2e6297c11d
commit 127fd0f3ad
2 changed files with 2 additions and 2 deletions

View file

@ -1,7 +1,7 @@
#!/bin/bash
_IP=`curl -s api.ipify.org`
echo $_IP > /tmp/my_ip
if [ "$_IP" == "<%= @protokol_pub_ip %>" ] ;then
if [[ $_IP =~ <%= @proto_pub_ip_regex %> ]] ;then
_IP=`curl -s 10.0.200.100/ip.sh`
echo $_IP >> /tmp/my_ip
fi