aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xfirma52
1 files changed, 20 insertions, 32 deletions
diff --git a/firma b/firma
index b3e68e9..16c6c30 100755
--- a/firma
+++ b/firma
@@ -904,7 +904,7 @@ function NewList {
while true; do
read -rep " List email address or 'quit' to exit: " LIST_ADDRESS
if [[ "$LIST_ADDRESS" == "quit" ]]; then
- return_code=1
+ exit 1
elif CheckValidEmail $LIST_ADDRESS; then
break
else
@@ -917,7 +917,7 @@ function NewList {
while true; do
read -rep " List administrator(s) email address(es) (space delimited) or 'quit' to exit: " LIST_ADMIN
if [[ "$LIST_ADDRESS" == "quit" ]]; then
- return_code=1
+ exit 1
else
for admin in $LIST_ADMIN; do
if ! CheckValidEmail $admin; then
@@ -936,6 +936,9 @@ function NewList {
# list description, passphrase and key size
if [[ "$return_code" == "0" ]]; then
read -rep " List description (optional): " KEY_DESCRIPTION
+ if [ ! -z "$KEY_DESCRIPTION" ]; then
+ KEY_DESCRIPTION="Name-Real: $KEY_DESCRIPTION"
+ fi
while true; do
read -rep " Automatically create a passphrase for the list pubkey? (Y/n) " answer
answer="$(echo $answer | tr '[:lower:]' '[:upper:]')"
@@ -960,11 +963,11 @@ function NewList {
echo " Please choose a key size:"
echo " 1 - 1024"
echo " 2 - 2048 (default)"
- echo " 2 - 4096"
+ echo " 3 - 4096"
read -rep " Please choose a key size or 'quit' to exit: " answer
answer="$(echo $answer | tr '[:lower:]' '[:upper:]')"
if [[ "$answer" == "QUIT" ]]; then
- return_code=1
+ exit 1
elif [[ "$answer" == "1" || "$answer" == "1024" ]]; then
KEY_SIZE="1024"
break
@@ -973,6 +976,7 @@ function NewList {
break
elif [[ "$answer" == "3" || "$answer" == "4096" ]]; then
KEY_SIZE="4096"
+ break
else
echo " Invalid answer."
fi
@@ -1018,38 +1022,21 @@ function NewList {
echo -e "KEY_SIZE='$KEY_SIZE'\nKEY_DESCRIPTION='$KEY_DESCRIPTION'" >> $LIST_CONFIG_FILE
echo "Now generating your keyring..."
- if [ -z "$KEY_DESCRIPTION" ]; then
- $GPG --gen-key <<EOF
-
- Key-Type: DSA
- Key-Length: $KEY_SIZE
- Subkey-Type: ELG-E
- Subkey-Length: $KEY_SIZE
+ $GPG --gen-key <<EOF
- Name-Email: $LIST_ADDRESS
+ Key-Type: DSA
+ Key-Length: $KEY_SIZE
+ Subkey-Type: ELG-E
+ Subkey-Length: $KEY_SIZE
- Expire-Date: $KEY_EXPIRATION
- Passphrase: $PASSPHRASE
- %commit
+ $KEY_DESCRIPTION
+ Name-Email: $LIST_ADDRESS
-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
+ Expire-Date: $KEY_EXPIRATION
+ Passphrase: $PASSPHRASE
+ %commit
EOF
- fi
# import admins pubkeys
while true; do
@@ -1083,6 +1070,7 @@ EOF
read -rep " Send list public key to list admins? (Y/n) " answer
answer="$(echo $answer | tr '[:lower:]' '[:upper:]')"
if [[ -z "$answer" || "$answer" == "Y" || "$answer" == "YES" ]]; then
+ SourceListConfig
SendListPubkey $LIST_ADMIN
break
elif [[ "$answer" == "N" || "$answer" == "NO" ]]; then
@@ -1106,7 +1094,7 @@ EOF
# fix permissions
chown -R $FIRMA_USER.$FIRMA_GROUP $LIST_HOMEDIR
- echo "Your list was created. No check its configuration at $LIST_CONFIG_FILE."
+ echo "Your list was created. Now check its configuration at $LIST_CONFIG_FILE."
echo "To see a list of optional config parameters, type firma --help config."
fi
else