tweak some of the prompting, to change defaults, and add PROMPT usage where missing
[monkeysphere.git] / src / share / m / gen_subkey
index 19d384ddc854935fab986735d3327138c39a7836..d926ad551116e57e6c3e4510b9923af5e7f23618 100644 (file)
@@ -86,12 +86,16 @@ Type '$PGRM help' for usage."
        fi
        # if authentication key is valid, prompt to continue
        if [ "$validity" = 'u' ] ; then
-           echo "A valid authentication key already exists for primary key '$keyID'."
-           read -p "Are you sure you would like to generate another one? (y/N) " OK; OK=${OK:N}
-           if [ "${OK/y/Y}" != 'Y' ] ; then
+           log error "A valid authentication key already exists for primary key '$keyID'."
+           if [ "$PROMPT" = "true" ] ; then
+               read -p "Are you sure you would like to generate another one? (y/N) " OK; OK=${OK:N}
+               if [ "${OK/y/Y}" != 'Y' ] ; then
+                   failure "aborting."
+               fi
+               break
+           else
                failure "aborting."
            fi
-           break
        fi
     done