e-smith-dynamicdns-dyndns.org/root/sbin/e-smith/dynamic-dns/dyndns.org

57 lines
1.7 KiB
Org Mode
Raw Permalink Normal View History

#!/bin/sh
# Description: www.dyndns.org (free service)
#------------------------------------------------------------
# dyndns.org dynamic DNS update handler.
#------------------------------------------------------------
IPADDR=$1
USERID=$2
PASSWD=$3
DOMAIN=$4
# This request will set wildcards on, such that *.$DOMAIN will resolve to
# $DOMAIN. Thus, if your domain is fred.dyndns.org, www.fred.dyndns.org
# will resolve as well.
wget -q -O /tmp/dyndns.log \
--user-agent="e-smith-dyndns.org/0.1" \
http://"$USERID:$PASSWD"@members.dyndns.org/nic/update?\
system=dyndns\&hostname="$DOMAIN"\&myip="$IPADDR"\&wildcard=ON
RESULT=`cat /tmp/dyndns.log`
case "$RESULT" in
good*)
logger -t dyndns.org "Update at $IPADDR succeeded." ;;
nochg*)
logger -t dyndns.org "IP Address $IPADDR already in database." ;;
notfqdn*)
logger -t dyndns.org \
"$DOMAIN is not a Fully-Qualified Domain Name." ;;
nohost*)
logger -t dyndns.org \
"$DOMAIN does not exist on the dyndns.org system." ;;
!yours*)
logger -t dyndns.org "$DOMAIN does not belong to you." ;;
badauth*)
logger -t dyndns.org "Bad username or password $USERID:$PASSWD." ;;
abuse*)
logger -t dyndns.org \
"$DOMAIN is blocked for abuse; contact support@dyndns.org" \
"to unblock." ;;
numhost*)
logger -t dyndns.org "Too many or too few hosts found." ;;
dnserr*)
logger -t dyndns.org "DNS Error encountered." \
"Response was $RESULT. Please contact support@dyndns.org." ;;
w*)
logger -t dyndns.org \
"NIC is currently unavailable. Response was $RESULT." ;;
911*)
logger -t dyndns.org "Something is horribly wrong." ;;
*)
logger -t dyndns.org "Unknown response $RESULT. Status was $?";;
esac
exit 0