diff options
-rwxr-xr-x | firma | 58 |
1 files changed, 35 insertions, 23 deletions
@@ -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 |