Not a bad idea, but I figured it was easier to  register with no-ip and
get myself a free dynamic DNS entry.
http://www.no-ip.com/

It came with an "updater" that just forms a URL that it passes to
no-ip.com that contains your IP address.
To be complete, this is what it sends for me:
GET
http://dynupdate.no-ip.com/update.php?username=xxxxxxx&pass=xxxxxxxx&host=gersmachine.no-ip.org&ip=66.41.74.6

It's a little different if you configure it differently.  You can
configure it as a daemon (I don't) and tell it you have proxy or nat
configured. It'd be trivial to put this in if-up.

Then I just ssh to gersmachine.no-ip.org.

This article might be of value:
http://www.no-ip.com/tips.php/id/3

Ger
--
Gerry Skerbitz
gsker at tcfreenet.org

On Thu, 1 Aug 2002, chewie wrote:
[SNIP]
> As with all DHCP setups, your computer may lease an IP address
> indefinitely, but there is always the chance that the DHCP server will
> allocate the address to someone else and give you a new one.  What was
> my answer?  With `ip', `shell', `sed', and `sendmail', I created a
> script that updates me whenever the IP address to my NIC changes.
[SNIP]