Using Synology NAS to email you when its IP changes

Here’s a shell script I use to make my Synology email me whenever my home IP address changes. Synology’s Task Scheduler can run a script on a schedule, with an option to email you if the task fails (exits with non-zero code). So what this script does specifically is check my public IP using ipinfo.io/io , and if the IP is different from the last time it checked, it prints the new IP and exits with…