Koozali.org: home of the SME Server

Dns2Go Update script

Shad

Dns2Go Update script
« on: November 28, 2001, 07:51:15 AM »
Here is an update script for those of you that have dns2go accounts. After creating the file below and setting permission like the other files in that directory do the following:

/sbin/e-smith/db configuration set DomainName (your dns2go domain)
/sbin/e-smith/db configuration set DynDnsService dns2go
/sbin/e-smith/db configuration set DynDnsAccount anything
/sbin/e-smith/db configuration set DynDnsPassword (your dns2go key)
/sbin/e-smith/signal-event console-save

The file should be created in the '/sbin/e-smith/dynamic-dns/' directory call the file 'dns2go':

#!/bin/sh
# Description: www.dyn2go.com

#------------------------------------------------------------
# dyn2go.com dynamic DNS update handler.
#------------------------------------------------------------

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

wget -O /dev/null -o /tmp/dns2go.log \
--user-agent="e-smith-dns2go.com/0.1" \
http://www.dns2go.com:83/?fqdn=$DOMAIN\&key=$PASSWD\&online=1\&ip=$IPADDR

RESULT=sed -ne 's/.*statusMsg=\(.*\)&.*\[following\]/\1/p' /tmp/dns2go.log
case "$RESULT" in
        Success)
            logger -t dns2go.com "Update at $IPADDR succeeded." ;;
        Access*denied)
            logger -t dns2go.com "Access denied." ;;
        Error*key*parameter)
            logger -t dns2go.com "Invalid key." ;;
        *)
            logger -t dns2go.com "Unknown response $RESULT. Status was $?";;
esac