Replace the echo functions with ways you'd like to be informed about an IP change (e-mail, etc.) and hit that script in a cron job.
I don't know if there is a specific function in openwrt to do this, but the script does basically the same - it's the not the most beautiful syntax, but it works.
# Create the log file
# grep current IP address
GETIP=$(curl -s ifconfig.me)
# log current IP address
echo $GETIP > $LOG
# check if ip changed
if [ "$OLD_IP" == "$GETIP" ]; then
echo 'NO change of IP address for' `hostname` $y 'on ' `date`
elif [ "$OLD_IP" != "$GETIP" ]; then
echo 'NEW IP address for' `hostname` 'is:' $y 'on ' `date`
I'm sorry for the inconvenience. The code above now works (inspired from here
, there is also the option to let the results be mailed to you)