summaryrefslogtreecommitdiff
path: root/src/share/mh
diff options
context:
space:
mode:
Diffstat (limited to 'src/share/mh')
-rw-r--r--src/share/mh/add_hostname5
-rw-r--r--src/share/mh/add_revoker4
-rw-r--r--src/share/mh/publish_key3
-rw-r--r--src/share/mh/revoke_hostname16
-rw-r--r--src/share/mh/revoke_key6
-rw-r--r--src/share/mh/set_expire3
6 files changed, 20 insertions, 17 deletions
diff --git a/src/share/mh/add_hostname b/src/share/mh/add_hostname
index 36f174d..9465d96 100644
--- a/src/share/mh/add_hostname
+++ b/src/share/mh/add_hostname
@@ -32,9 +32,8 @@ find_host_userid > /dev/null && \
failure "Host userID '$userID' already exists."
if [ "$PROMPT" = "true" ] ; then
- read -p "The following user ID will be added to the host key:
- $userID
-Are you sure you would like to add this user ID? (Y/n) " OK; OK=${OK:=Y}
+ printf "The following user ID will be added to the host key:\n %s\nAre you sure you would like to add this user ID? (Y/n) " "$userID" >&2
+ read OK; OK=${OK:=Y}
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "User ID not added."
fi
diff --git a/src/share/mh/add_revoker b/src/share/mh/add_revoker
index 077b0d0..e58995b 100644
--- a/src/share/mh/add_revoker
+++ b/src/share/mh/add_revoker
@@ -90,8 +90,8 @@ EOF
su_monkeysphere_user "GNUPGHOME=$tmpDir gpg --fingerprint 0x${fingerprint}!"
if [ "$PROMPT" = "true" ] ; then
- read -p "Are you sure you want to add the above key as a revoker
-of the host key? (Y/n) " OK; OK=${OK:-Y}
+ printf "Are you sure you want to add the above key as a revoker\nof the host key? (Y/n) " >&2
+ read OK; OK=${OK:-Y}
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "revoker not added."
fi
diff --git a/src/share/mh/publish_key b/src/share/mh/publish_key
index b0ffd93..f6e1c0f 100644
--- a/src/share/mh/publish_key
+++ b/src/share/mh/publish_key
@@ -18,7 +18,8 @@ publish_key() {
local GNUPGHOME
if [ "$PROMPT" = "true" ] ; then
- read -p "Really publish host key to $KEYSERVER? (Y/n) " OK; OK=${OK:=Y}
+ printf "Really publish host key to $KEYSERVER? (Y/n) " >&2
+ read OK; OK=${OK:=Y}
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "key not published."
fi
diff --git a/src/share/mh/revoke_hostname b/src/share/mh/revoke_hostname
index 5dc327f..44ba312 100644
--- a/src/share/mh/revoke_hostname
+++ b/src/share/mh/revoke_hostname
@@ -27,11 +27,12 @@ if [ -z "$1" ] ; then
failure "You must specify a hostname to revoke."
fi
-echo "WARNING: There is a known bug in this function."
-echo "This function has been known to occasionally revoke the wrong hostname."
-echo "Please see the following bug report for more information:"
-echo "https://labs.riseup.net/code/issues/show/422"
-read -p "Are you sure you would like to proceed? (y/N) " OK; OK=${OK:=N}
+echo "WARNING: There is a known bug in this function.
+This function has been known to occasionally revoke the wrong hostname.
+Please see the following bug report for more information:
+https://labs.riseup.net/code/issues/show/422" >&2
+printf "Are you sure you would like to proceed? (y/N) " >&2
+read OK; OK=${OK:=N}
if [ ${OK/y/Y} != 'Y' ] ; then
failure "aborting."
fi
@@ -43,9 +44,8 @@ uidIndex=$(find_host_userid) || \
failure "No non-revoked user ID found matching '$userID'."
if [ "$PROMPT" = "true" ] ; then
- read -p "The following host key user ID will be revoked:
- $userID
-Are you sure you would like to revoke this user ID? (Y/n) " OK; OK=${OK:=Y}
+ printf "The following host key user ID will be revoked:\n %s\nAre you sure you would like to revoke this user ID? (Y/n) " "$userID" >&2
+ read OK; OK=${OK:=Y}
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "User ID not revoked."
fi
diff --git a/src/share/mh/revoke_key b/src/share/mh/revoke_key
index ad68d5f..5460e51 100644
--- a/src/share/mh/revoke_key
+++ b/src/share/mh/revoke_key
@@ -33,7 +33,8 @@ Publishing this certificate will IMMEDIATELY and PERMANENTLY revoke
your host key!
EOF
- read -p "Publish the certificate after generation? (y/n/Q) " publish
+ printf "Publish the certificate after generation? (y/n/Q) " >&2
+ read publish
if ! [ "${publish/y/Y}" = 'Y' -o "${publish/n/N}" = 'N' ] ; then
failure "aborting at user request"
@@ -87,7 +88,8 @@ y
if [ "${publish/y/Y}" = 'Y' ] ; then
printf "\n" >&2
- read -p "Really publish this cert to $KEYSERVER ? (Y/n) " really
+ printf "Really publish this cert to $KEYSERVER ? (Y/n) " >&2
+ read really
if [ "${really/n/N}" = 'N' ] ; then
printf "Not publishing.\n" >&2
else
diff --git a/src/share/mh/set_expire b/src/share/mh/set_expire
index a6bf1f1..9889e76 100644
--- a/src/share/mh/set_expire
+++ b/src/share/mh/set_expire
@@ -22,7 +22,8 @@ local extendTo
extendTo=$(get_gpg_expiration "$1")
if [ "$PROMPT" = "true" ] ; then
- read -p "Are you sure you want to change the expiration on the host key to '$extendTo'? (Y/n) " OK; OK=${OK:-Y}
+ printf "Are you sure you want to change the expiration on the host key to '%s'? (Y/n) " "$extendTo" >&2
+ read OK; OK=${OK:-Y}
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "expiration not set."
fi