summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2002-08-09 01:32:55 +0000
committerJonas Smedegaard <dr@jones.dk>2002-08-09 01:32:55 +0000
commit4e4f4dd009c49041a69f35cbe974ac18847cd3ac (patch)
treebb66fc44efda0b6314e4e08164776db8a90c1b3c
parent913e0a786f06c413ec5b0aa7bc77a7be26dc01b7 (diff)
localnsrequest: Attempt to make GnuPG work (but commented out for now...).
-rwxr-xr-xlocalnsrequest70
1 files changed, 46 insertions, 24 deletions
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 <dr@jones.dk>
+#
+# $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 <dr@jones.dk>"
usage="$prg, $copyright
-Usage: $prg <handle> reg|redel <domain> [<otherdomain.dk> ...]"
+Usage: $prg <handle> reg|redel <domain> [<otherdomain> ...]"
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\"!"