summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2012-09-13 07:43:16 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2012-09-13 07:43:16 +0200
commit5ebe3f0a8949f4cafa2f2015fee96a6ed4bc1dce (patch)
treedfa1745b9ed66b7f47eadfff0ea37d8d15ddd42a
parentb11e15a02b938f5cb3c6ce42f5307c92c0748d49 (diff)
downloadpass-5ebe3f0a8949f4cafa2f2015fee96a6ed4bc1dce.tar.gz
pass-5ebe3f0a8949f4cafa2f2015fee96a6ed4bc1dce.tar.bz2
pass-5ebe3f0a8949f4cafa2f2015fee96a6ed4bc1dce.zip
Use bash's read command better.
-rwxr-xr-xsrc/password-store.sh22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index 12ef62b..402563c 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -193,14 +193,10 @@ case "$command" in
cat | gpg -e -r "$ID" -o "$passfile" --yes
elif [[ $noecho -eq 1 ]]; then
while true; do
- stty -echo
- echo -n "Enter password for $path: "
- read password
+ read -p "Enter password for $path: " -s password
echo
- echo -n "Retype password for $path: "
- read password_again
+ read -p "Retype password for $path: " -s password_again
echo
- stty echo
if [[ $password == $password_again ]]; then
gpg -q -e -r "$ID" -o "$passfile" --yes <<<"$password"
break
@@ -233,14 +229,12 @@ case "$command" in
if [[ -d /dev/shm && -w /dev/shm && -x /dev/shm ]]; then
tmp_dir="$(TMPDIR=/dev/shm mktemp -t $template -d)"
else
- echo "Your system does not have /dev/shm, which means that it may"
- echo "be difficult to entirely erase the temporary non-encrypted"
- echo "password file after editing. Are you sure you would like to"
- echo -n "continue? [y/N] "
- read yesno
- if ! [[ $yesno == "y" || $yesno == "Y" ]]; then
- exit 1
- fi
+ prompt=$(echo "Your system does not have /dev/shm, which means that it may"
+ echo "be difficult to entirely erase the temporary non-encrypted"
+ echo "password file after editing. Are you sure you would like to"
+ echo -n "continue? [y/N] ")
+ read -p "$prompt" yesno
+ [[ $yesno == "y" || $yesno == "Y" ]] || exit 1
tmp_dir="$(mktemp -t $template -d)"
fi
tmp_file="$(TMPDIR="$tmp_dir" mktemp -t $template)"
6503&follow=1'>Add support for downloading single blobsLars Hjemli5-3/+47 2007-05-08ui-view: show pathname if specified in querystringLars Hjemli3-5/+10 2007-05-08Update to libgit 1.5.2-rc2Lars Hjemli9-837/+50 2007-02-21Layout updateLars Hjemli9-32/+127 2007-02-08Make snapshot feature configurableLars Hjemli5-6/+22 2007-02-08Add support for snapshotsLars Hjemli8-8/+153 2007-02-05cgit v0.2v0.2Lars Hjemli1-1/+1 2007-02-05Add support for prefix and gitsrc arguments to 'make'Lars Hjemli2-15/+37 2007-02-04Update cgitrc templateLars Hjemli1-21/+32 2007-02-04Add support for lightweight tagsLars Hjemli2-19/+37 2007-02-04Read repo-info from /etc/cgitrcLars Hjemli5-55/+120 2007-02-04Do not die if tag has no messageLars Hjemli1-2/+2 2007-02-03Fix search for non-virtual urlsLars Hjemli1-0/+6 2007-01-28Update README with install/config informationLars Hjemli1-24/+28