Hi everyone: I was happily SSH'ing into my home-PC, well aware that the first part of DHCP means "dynamic"... For quite a long time, my IP-address stayed the same, then yesterday, I couldn't get into my machine (from work). That prompted some thinking (always dangerous :-) ). I thought I'd share what I did, and hope that it may help someone else, or stimulate an even better solution. In a nutshell, I have my home-SuSE machine check the IP-address every hour. If it sees a change, then it mails me the new IP-address (to my work-email). (Note: I read the man-page for dhcpcd, and it looks like there is a facility to run a script only when the DHCP-client status changes. This may be a better way to do things, rather than my cron approach. Nonetheless, my parsing and notification may still be useful, even if the trigger-event is different). Without further ado, here is the bash-script: #!/bin/bash # ip_check.sh # Written by Gordon Pritchard. Feb. 12, 2002. # The purpose of this script it to check (via cron) if my DHCP # assigned IP-address has changed. If not, do nothing. If yes, # mail me the new IP-address. # Place this file in /etc/cron.hourly (SuSE system), and set the # owner/group to 'root'. Make sure it's executable. # First, we'll get the current IP-address /sbin/ifconfig eth0 | awk '/inet / {print $2}' > latest_ip # See if our latest IP-address is the same as the previously # assigned IP-address. This works fine the first time this # script is run, and previous_ip doesn't exist. if cmp -s latest_ip previous_ip then exit else cp latest_ip previous_ip mail -s "IP address change!" username@domain < latest_ip fi # You've got mail :-) -Gord -- Gordon Pritchard, P.Eng., Member IEEE Technical University of B.C. - Research Lab Engineer mailto:gordon.pritchard@techbc.ca direct phone: 604-586-6186