I recently ran across the same trouble, needing to update some things whenever my home ISP shuffles me around.And since there are a million ways to solve this, I ended up writing a shell script. I made it pretty generic so I can reuse it on different configurations.Here's the main script I run from cron:

CODE

#!/bin/bashNUMPARAMS=3if [ $# -lt "$NUMPARAMS" ]then echo "Usage: checkip dev save-file change-script" echo " eg: checkip eth0 /etc/dhcp/current_ip.txt /etc/dhcp/ip_changed_script" echo "" echo " change-script will be called with the new ip as a parameter" echo " This script is best run from crontab every few minutes" exit 0fi

It tracks the last ip in a file you can specify on the command line, you can also specify the interface to check and the name of the script to run when it detects a change.In my case, I have it call this script: