You can do this with a device on your LAN also. Instead of getting the IP from the interface just use something like
ip=$(curl http://icanhazip.com)
You can do this with a device on your LAN also. Instead of getting the IP from the interface just use something like
ip=$(curl http://icanhazip.com)