Me(static IP, FreeBSD) and my friend(dynamic IP, adsl, MacOS X) uses the following strategy for uploading his IP to my (name)server. So that we always can reach his mac via it's name.
You would probably only need the client side script. As you can se we update the DNS record for his machine on my name server.
(Addresses altered for privacy reasons)
On the OS X client this is cron'ed every 5 minutes
---------------------------------------------------
#!/bin/sh
#
set path = /sbin /usr/bin
#
OIP=`cat /var/log/tyraip`
NIP=`/sbin/ifconfig en0 | /usr/bin/grep 'inet 2' | sed 's/inet//' | sed 's/netmask.*//'`
if EXPR=$(expr $NIP : $OIP); then
echo `date +'%y-%m-%d% %H:%M:%S'` -- ${NIP}
exit 0
fi
echo `date +'%y-%m-%d% %H:%M:%S'` ++ ${NIP}
echo ${NIP} > /var/log/tyraip
curl -T /var/log/tyraip
ftp://name:pw@server.com/tyraip
exit 0
---------------------------------------------------
On the FreeBSD server this is cron'ed every 5 minutes
---------------------------------------------------
#!/bin/sh
#
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
IPFILE="/home/server.com/users/visitor/tyraip"
#
if ! test -f $IPFILE; then
echo `date +'%y-%m-%d% %H:%M:%S'` -- no change
exit 0
fi
TYRAIP=`cat $IPFILE`
if test -n "$TYRAIP"; then
cp /etc/namedb/tyra.host2.se.proto /etc/namedb/tyra.host2.se
echo "@ IN A "$TYRAIP >> /etc/namedb/tyra.host2.se
kill -HUP `ps -x | grep 'named' | grep -v 'grep' | awk '{print $1}'`
rm -f $IPFILE
echo `date +'%y-%m-%d% %H:%M:%S'` new ip ${TYRAIP}
fi
exit 0
--------------------------------------------
I hope this can be of any help to you.