Created
August 25, 2010 17:02
-
-
Save apk/549864 to your computer and use it in GitHub Desktop.
DynDNS update script for occasionally changing IPs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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:[email protected]/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