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
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
# 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:]')"
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
break
elif [[ "$answer" == "3" || "$answer" == "4096" ]]; then
KEY_SIZE="4096"
+ break
else
echo " Invalid answer."
fi
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
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
# 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