]> gitweb.fluxo.info Git - firma.git/commitdiff
small fixes
authorrhatto <rhatto>
Fri, 13 Jul 2007 22:22:23 +0000 (22:22 +0000)
committerrhatto <rhatto>
Fri, 13 Jul 2007 22:22:23 +0000 (22:22 +0000)
firma

diff --git a/firma b/firma
index 9ff8dda46cb9cc2f34a81a1c32d6fed4bc5d76a9..13f1d1138fd778372b51dbe3be71ba20b9fa2dc2 100755 (executable)
--- a/firma
+++ b/firma
@@ -1018,21 +1018,38 @@ function NewList {
           echo -e "KEY_SIZE='$KEY_SIZE'\nKEY_DESCRIPTION='$KEY_DESCRIPTION'" >> $LIST_CONFIG_FILE
           echo "Now generating your keyring..."
 
-          $GPG --gen-key <<EOF
+          if [ -z "$KEY_DESCRIPTION" ]; then
+            $GPG --gen-key <<EOF
 
-            Key-Type: DSA
-            Key-Length: $KEY_SIZE
-            Subkey-Type: ELG-E
-            Subkey-Length: $KEY_SIZE
+              Key-Type: DSA
+              Key-Length: $KEY_SIZE
+              Subkey-Type: ELG-E
+              Subkey-Length: $KEY_SIZE
 
-            Name-Real: $KEY_DESCRIPTION
-            Name-Email: $LIST_ADDRESS
+              Name-Email: $LIST_ADDRESS
 
-            Expire-Date: $KEY_EXPIRATION
-            Passphrase: $PASSPHRASE
-            %commit
+              Expire-Date: $KEY_EXPIRATION
+              Passphrase: $PASSPHRASE
+              %commit
 
 EOF
+          else
+            $GPG --gen-key <<EOF
+
+              Key-Type: DSA
+              Key-Length: $KEY_SIZE
+              Subkey-Type: ELG-E
+              Subkey-Length: $KEY_SIZE
+
+              Name-Real: $KEY_DESCRIPTION
+              Name-Email: $LIST_ADDRESS
+
+              Expire-Date: $KEY_EXPIRATION
+              Passphrase: $PASSPHRASE
+              %commit
+
+EOF
+          fi
 
           # import admins pubkeys
           while true; do
@@ -1553,24 +1570,19 @@ function SubscribeUsers {
       return_code=1
     fi
   elif [[ "$1" == "file" ]]; then
-    if [[ "$MODE" == "admin-interactive" ]]; then
-      if [[ -n "$2" ]]; then
-        if [[ -f "$2" ]]; then
-          $GPG --import < $2
-          return_code=$?
-          if [[ "$return_code" == "0" ]]; then
-            AdminLog "subscription: success"
-          fi
-        else
-          echo >&2 "subscribe: cant add subscribers from $1: no such file or directory"
-          return_code=1
+    if [[ -n "$2" ]]; then
+      if [[ -f "$2" ]]; then
+        $GPG --import < $2
+        return_code=$?
+        if [[ "$return_code" == "0" ]]; then
+          AdminLog "subscription: success"
         fi
       else
-        echo >&2 "subscribe: missing parameters: subscribe file requires a file name"
+        echo >&2 "subscribe: cant add subscribers from $1: no such file or directory"
         return_code=1
       fi
     else
-      AdminLog "subscribe: file option only valid in the interactive (command-line) mode"
+      echo >&2 "subscribe: missing parameters: subscribe file requires a file name"
       return_code=1
     fi
   elif [[ "$1" == "keyserver" ]]; then