From 913e0a786f06c413ec5b0aa7bc77a7be26dc01b7 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 8 Aug 2002 15:38:59 +0000 Subject: Rewrite localnsrequest-dk to support TotalRegistrations and rename to localnsrequest. --- localnsrequest | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100755 localnsrequest (limited to 'localnsrequest') diff --git a/localnsrequest b/localnsrequest new file mode 100755 index 0000000..30834c5 --- /dev/null +++ b/localnsrequest @@ -0,0 +1,104 @@ +#!/bin/sh + +prg=$(basename $0) +copyright="(C) 2002 Jonas Smedegaard " + +usage="$prg, $copyright + +Usage: $prg reg|redel [ ...]" + +if [ $# \< 3 ]; then + echo "Too few parameters!" + echo + echo "$usage" + exit 1 +fi +handle=$1 +shift +action=$1 +shift + +if [ -z "$handle" ]; then + echo "Error: Missing handle!" + echo + echo "$usage" + exit 1 +fi + +case $action in + reg) + file=domain.3.00.dansk.txt-$handle + ;; + redel) + file=redelegation.3.00.dansk.txt-$handle + ;; + *) + echo "Unsupported action: \"$action\"!" + echo + echo "$usage" + exit 1 + ;; +esac + +if [ ! -f $dir/$file ]; then + echo "Error: File \"$dir/$file\" doesn't exist!" + echo "Did you use a valid handle?" + echo + echo "$usage" + exit 1 +fi + +BCC="" +[ -n "$EMAIL" ] && BCC="-c $EMAIL" + +for DOMAIN in $@; do + case $DOMAIN in + *.dk) + dir='/etc/local-COMMON/DK-Hostmaster' + TO="hostmaster@dk-hostmaster.dk" + case $action in + reg) + file=domain.3.00.dansk.txt-$handle + ;; + redel) + file=redelegation.3.00.dansk.txt-$handle + ;; + *) + echo "Unsupported action: \"$action\"!" + echo + echo "$usage" + exit 1 + ;; + esac + sed -e "s/{DOMAIN}/$DOMAIN/g" $dir/$file \ + | mail -s "$action $DOMAIN ($handle)" -a "Content-Type: TEXT/PLAIN; charset=ISO-8859-1" $BCC -e $TO + ;; + *.com|*.org|*.net) + dir='/etc/local-COMMON/TotalRegistrations' + TO="register@totalregistrations.com" + file=email-$handle + case $action in + reg) + ACTION=N + ;; + redel) + ACTION=T + ;; + *) + echo "Unsupported action: \"$action\"!" + echo + echo "$usage" + exit 1 + ;; + esac + sed -e "s/{DOMAIN}/$DOMAIN/g" -e "s/{ACTION}/$ACTION/g" -e "s/{PASSWD}/$PASSWD/g" $dir/$file \ + | mail -s "$action $DOMAIN ($handle)" -a "Content-Type: TEXT/PLAIN; charset=ISO-8859-1" $BCC -e $TO + ;; + *) + echo "Unsupported domain: \"$DOMAIN\"!" + echo + echo "$usage" + exit 1 + ;; + esac +done -- cgit v1.2.3