Contribute  :  Advanced Search  :  Site Statistics  :  Directory  :  Polls  :  ABOUT MUTAKU.com  :  Folding@Home  :  NerdcoreProductions.com  :  STORE  
Mutaku.com Fresh brewed daily
Welcome to Mutaku.com
Wednesday, September 08 2010 @ 09:05 PM EDT
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Improvements I made
Authored by: Anonymous on Saturday, January 26 2008 @ 07:05 AM EST
Thanks for the idea. Much better than any dyndns clients I have tried. Here is my first pass at only uploading changes:
#!/bin/bash

# grab our IP by downloading the page resulting for checkip.dyndns.com
wget -O indexnew.html checkip.dyndns.com

# if the address has changed, upload this page we created to our ftp site
if [ $(diff indexnew.html index.html) ]; then
	mv -f indexnew.html index.html
	ftp -v -n "site-we-have-access-to.com" << EOF
	user "username-here" "password-here"
	cd /our-user-account-directory/htdocs/directory-for-ip/
	put index.html
	quit
EOF
else
	rm -f indexnew.html
fi
Since my IP changes at totally random times, I upped my crontab entry to every 15 minutes:
*/15 * * * * /usr/bin/ip 1> /dev/null
If you want to strip out just the IP address to use in a script for updating a nameserver, you can do it with:
html2text index.html | awk '{print $4}'
or
html2text ip.html | sed 's/Current IP Address: //'