while true; do
read -rep " List email address or 'quit' to exit: " LIST_ADDRESS
if [[ "$LIST_ADDRESS" == "quit" ]]; then
+ echo "Deleting folder $LIST_HOMEDIR..."
+ rm -rf $LIST_HOMEDIR
+ echo "List creation aborted."
exit 1
elif CheckValidEmail $LIST_ADDRESS; then
break
if [[ "$return_code" == "0" ]]; then
while true; do
read -rep " List administrator(s) email address(es) (space delimited) or 'quit' to exit: " LIST_ADMIN
- if [[ "$LIST_ADDRESS" == "quit" ]]; then
+ if [[ "$LIST_ADMIN" == "quit" ]]; then
+ echo "Deleting folder $LIST_HOMEDIR..."
+ rm -rf $LIST_HOMEDIR
+ echo "List creation aborted."
exit 1
else
for admin in $LIST_ADMIN; do
read -rep " Please choose a key size or 'quit' to exit: " answer
answer="$(echo $answer | tr '[:lower:]' '[:upper:]')"
if [[ "$answer" == "QUIT" ]]; then
+ echo "Deleting folder $LIST_HOMEDIR..."
+ rm -rf $LIST_HOMEDIR
+ echo "List creation aborted."
exit 1
elif [[ "$answer" == "1" || "$answer" == "1024" ]]; then
KEY_SIZE="1024"
KEY_EXPIRATION="0"
break
elif [[ "$KEY_EXPIRATION" == "quit" ]]; then
- return_code=1
+ echo "Deleting folder $LIST_HOMEDIR..."
+ rm -rf $LIST_HOMEDIR
+ echo "List creation aborted."
+ exit 1
elif [[ -z "$(echo $digits_only | sed -e 's/[0-9]//g')" || -n "$last_char" ]]; then
break
else