summaryrefslogtreecommitdiff
path: root/src/share
diff options
context:
space:
mode:
authormike castleman <m@mlcastle.net>2009-07-11 16:19:31 -0400
committermike castleman <m@mlcastle.net>2009-07-11 16:19:31 -0400
commita2704823c7770bc8df9377116877fcca78c3ea12 (patch)
tree9b018557b71721194835d14c9df0cc66d5dbd8db /src/share
parent4d9da8f75a38327d4a9fc1506739221f9fea9c2a (diff)
more replacement of read -p with printf; read (re #446)
Diffstat (limited to 'src/share')
-rw-r--r--src/share/common3
-rw-r--r--src/share/ma/add_certifier4
-rw-r--r--src/share/ma/remove_certifier3
-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
9 files changed, 26 insertions, 21 deletions
diff --git a/src/share/common b/src/share/common
index bd887d3..c88857e 100644
--- a/src/share/common
+++ b/src/share/common
@@ -291,7 +291,8 @@ Please specify how long the key should be valid.
<n>y = key expires in n years
EOF
while [ -z "$keyExpire" ] ; do
- read -p "Key is valid for? (0) " keyExpire
+ printf "Key is valid for? (0) " >&2
+ read keyExpire
if ! test_gpg_expire ${keyExpire:=0} ; then
echo "invalid value" >&2
unset keyExpire
diff --git a/src/share/ma/add_certifier b/src/share/ma/add_certifier
index 402da08..1601997 100644
--- a/src/share/ma/add_certifier
+++ b/src/share/ma/add_certifier
@@ -136,8 +136,8 @@ EOF
gpg_sphere "--fingerprint 0x${fingerprint}!"
if [ "$PROMPT" = "true" ] ; then
- echo "Are you sure you want to add the above key as a certifier"
- read -p "of users on this system? (Y/n) " OK; OK=${OK:-Y}
+ printf "Are you sure you want to add the above key as a certifier\nof users on this system? (Y/n) " >&2
+ read OK; OK=${OK:-Y}
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "Identity certifier not added."
fi
diff --git a/src/share/ma/remove_certifier b/src/share/ma/remove_certifier
index 6c90358..79f1cda 100644
--- a/src/share/ma/remove_certifier
+++ b/src/share/ma/remove_certifier
@@ -27,7 +27,8 @@ fi
gpg_core --list-key --fingerprint "0x${keyID}!" || failure
if [ "$PROMPT" = "true" ] ; then
- read -p "Really remove the above listed identity certifier? (Y/n) " OK; OK=${OK:-Y}
+ printf "Really remove the above listed identity certifier? (Y/n) " >&2
+ read OK; OK=${OK:-Y}
if [ "${OK/y/Y}" != 'Y' ] ; then
failure "Identity certifier not removed."
fi
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