#!/bin/bash # # updates ZONEEDIT.COM dynamic dns service by 31d1@31d1.com # meant to be run with cron # v0.2 # file to store IP info in STORE='/Users/username/bin/.temp' # scp a copy to REMOTE='user@site.org/path/to/page' # user:pass @ ZONEEDIT PW='uuuuuu:pppppp' # if ! -u show curr IP [ "$1" != "-u" ] && { cat "$STORE" exit } # update CURRIP=$(/usr/bin/curl -s 'http://ip.cutup.org/' 2>/dev/null) [ "$CURRIP" == "" ] && exit OLDIP=$(cat "$STORE") [ "$CURRIP" != "$OLDIP" ] && { echo "$CURRIP" > "$STORE" # the next line updates YOUR.SITE and *.YOUR.SITE, you can add SUB.YOUR.SITE /usr/bin/curl -s -u "$PW" 'http://dynamic.zoneedit.com/auth/dynamic.html?host=YOUR.SITE,*.YOUR.SITE' [ "$REMOTE" ] && scp "$STORE" "$REMOTE" }