Skip to content

Instantly share code, notes, and snippets.

@apk
Created August 25, 2010 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apk/549864 to your computer and use it in GitHub Desktop.
Save apk/549864 to your computer and use it in GitHub Desktop.
DynDNS update script for occasionally changing IPs
#!/bin/sh
cd `dirname $0`
exec >>dyndns.log 2>&1
LANG=C
export LANG
date
ip=`/sbin/ifconfig eth3 | sed -ne 's,^.*inet addr:\([0-9.]*\) .*$,\1,p'`
echo ip: $ip
if test X"`cat ip`" = X"$ip"; then
echo Same addr
else
echo Diff addr
rm -f tag
fi
if test X`find tag -mtime -28` = X; then
touch tag
/usr/bin/wget --no-check-certificate -O - https://yourname:yourpass@members.dyndns.org/nic/update?hostname=youraddr.ath.cx | cat
fi
echo $ip >ip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment