Update astgenkey to make empty ones too
authorMark Spencer <markster@digium.com>
Wed, 15 Sep 2004 04:19:58 +0000 (04:19 +0000)
committerMark Spencer <markster@digium.com>
Wed, 15 Sep 2004 04:19:58 +0000 (04:19 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3780 65c4cc65-6c06-0410-ace0-fbb531ad65f3

contrib/scripts/astgenkey

index 31873e8..6376048 100755 (executable)
@@ -1,10 +1,24 @@
 #!/bin/sh
 #
-# Usage: astgenkey [ -q ] [keyname]
+# Usage: astgenkey [ -q ] [ -n ] [keyname]
 #
+DES3=-des3
 if [ "$1" = "-q" ]; then
        QUIET='y'
-       KEY=$2
+       if [ "$2" = "-n" ]; then
+               DES3=
+               KEY=$3
+       else
+               KEY=$2
+       fi
+elif [ "$1" = "-n" ]; then
+       DES3=
+       if [ "$2" = "-q" ]; then
+               QUIET='y'
+               KEY=$3
+       else
+               KEY=$2
+       fi
 else
        KEY=$1
 fi
@@ -33,7 +47,7 @@ done
 rm -f ${KEY}.key ${KEY}.pub
 
 echo "Generating SSL key '$KEY': "
-openssl genrsa -out ${KEY}.key -des3 1024
+openssl genrsa -out ${KEY}.key ${DES3} 1024
 openssl rsa -in ${KEY}.key -pubout -out ${KEY}.pub
 
 if [ -f "${KEY}.key" ] && [ -f "${KEY}.pub" ]; then