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

1.7 KiB
Raw Permalink Blame History

#!/bin/sh

#————————————————————

#————————————————————

IPADDR=$1 USERID=$2 PASSWD=$3 DOMAIN=$4

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