Perhaps an easier way I have set up on my own server.
I have my server check its external ip address every 15 minutes (times between checks are customisable by cron)
It then compares this with its most recent ip address and if it has changed, it emails me the new ip address.
I'm on my phone at the minute but can send the setup through if you like, it's really quite simple and pretty reliable except for the odd spurious email when the server can't reach the ip checker.
Update - here's the script. You obviously need a functioning email account running, personally I have mine set up to send from a dedicated gmail account using this guide
#!/bin/sh
IPADDRESS=$(curl https://wtfismyip.com/text)
if [ "$IPADDRESS" != "$(cat /home/will/scripts/.current_ip)" ]
then
dt=$(date)
echo "Your new IP address as of ${dt} is ${IPADDRESS} \r \r FTB" | mail -s "IP address change" [email protected]
echo "$IPADDRESS" >| /home/will/scripts/.current_ip
echo "$dt $IPADDRESS" >> /home/will/scripts/.iphistory
fi
I'd start off by touch .current_ip && touch .iphistory
in the directory where you're going to store the files. It has the added advantage of keeping a record of IP changes, though I haven't found much use for it to be honest.
Set the script up to run as a cron job as often as you like. It's not very resource intensive.