From 4e4f4dd009c49041a69f35cbe974ac18847cd3ac Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Fri, 9 Aug 2002 01:32:55 +0000 Subject: localnsrequest: Attempt to make GnuPG work (but commented out for now...). --- localnsrequest | 70 ++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 24 deletions(-) (limited to 'localnsrequest') diff --git a/localnsrequest b/localnsrequest index 30834c5..6e6d4da 100755 --- a/localnsrequest +++ b/localnsrequest @@ -1,11 +1,26 @@ #!/bin/sh +# +# /usr/local/bin/localnsrequest +# Copyright 2001, 2002 Jonas Smedegaard +# +# $Id: localnsrequest,v 1.2 2002-08-09 01:32:55 jonas Exp $ +# +# Send requests regarding domain registrations to registrars +# +# TODO +# * Loop through all options *before* sending any mail, to exit +# on error with no half-done batch +# * Look for password in home, similar to mysql my.cnf. +# * Clean up the mess of handles being both e.g. spiff and radar +# + prg=$(basename $0) copyright="(C) 2002 Jonas Smedegaard " usage="$prg, $copyright -Usage: $prg reg|redel [ ...]" +Usage: $prg reg|redel [ ...]" if [ $# \< 3 ]; then echo "Too few parameters!" @@ -25,29 +40,6 @@ if [ -z "$handle" ]; then 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" @@ -67,9 +59,20 @@ for DOMAIN in $@; do echo "Unsupported action: \"$action\"!" echo echo "$usage" + echo + echo "Supported actions for this TLD: reg redel" 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 + 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 ;; @@ -88,11 +91,30 @@ for DOMAIN in $@; do echo "Unsupported action: \"$action\"!" echo echo "$usage" + echo + echo "Supported actions for this TLD: reg redel" exit 1 ;; esac + echo -n "Enter TotalRegistrations password: " + read -s PASSWD + echo + [ -z "$PASSWD" ] && { + echo "No password provided. Exiting..." + exit 1 + } + + 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 + 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 +# | gpg -ea -r $TO | mail -s "$action $DOMAIN ($handle)" -a "Content-Type: TEXT/PLAIN; charset=ISO-8859-1" $BCC -e $TO ;; *) echo "Unsupported domain: \"$DOMAIN\"!" -- cgit v1.2.3