aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhatto <rhatto>2007-07-13 22:22:23 +0000
committerrhatto <rhatto>2007-07-13 22:22:23 +0000
commit5f243adc1b82fb81a976f14c7ba95867879da1f9 (patch)
treec54cfa0a2821dd85b945d4c8135d50993c2f7f15
parentb2b8d4d3afe0d971235e21158cdc6a7a078a1e0a (diff)
downloadfirma-5f243adc1b82fb81a976f14c7ba95867879da1f9.tar.gz
firma-5f243adc1b82fb81a976f14c7ba95867879da1f9.tar.bz2
small fixes
-rwxr-xr-xfirma58
1 files changed, 35 insertions, 23 deletions
diff --git a/firma b/firma
index 9ff8dda..13f1d11 100755
--- 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