Merge commit 'jrollins/master'
[monkeysphere.git] / src / share / mh / import_key
index 040b41c57140862760b9e10dcac2189bdcb44f65..c545388f9aaedd0300d899acc5ded47d029e7533 100644 (file)
@@ -44,6 +44,21 @@ fi
 
 userID="ssh://${hostName}"
 
+if [ "$PROMPT" = "true" ] ; then
+    cat <<EOF
+The ssh key will be imported and an OpenPGP certificate for this host
+will be generated with the following user ID:
+  $userID
+EOF
+    read -p "Are you sure you would like to create certificate? [Y/n] " OK; OK=${OK:-Y}
+    if [ "${OK/y/Y}" != 'Y' ] ; then
+       failure "ssh key not imported."
+    fi
+else
+    log debug "importing key without prompting."
+fi
+
+
 # create host home
 mkdir -p "${MHDATADIR}"
 mkdir -p "${GNUPGHOME_HOST}"