summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspeedie <speedie@speedie.site>2024-03-18 17:48:15 +0100
committerspeedie <speedie@speedie.site>2024-03-18 17:48:15 +0100
commit11e54213dd16fb3b39be934ce0d465483ddfed80 (patch)
tree2a54a06f33526443d65666bead55f30a688d782d
parenta8863a750a360bad6759f5f2c4df5d2001b31e18 (diff)
Don't prompt for password, if the email address already has a saved
password. This is useful if you copy your .password-store directory from one computer to another.
-rwxr-xr-xbin/mw6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/mw b/bin/mw
index cdb7856..44086be 100755
--- a/bin/mw
+++ b/bin/mw
@@ -173,11 +173,11 @@ askinfo() {
[ -z "$passprefix" ] && passprefix=""
hostname="${fulladdr#*@}"
login="${login:-$fulladdr}"
- if [ -n "${password+x}" ]; then
+ if [ -n "${password+x}" ] && [ ! -f "$PASSWORD_STORE_DIR/$passprefix$fulladdr.gpg" ]; then
insertpass
- else
+ elif [ ! -f "$PASSWORD_STORE_DIR/$passprefix$fulladdr.gpg" ]; then
getpass
- fi
+ fi
}
insertpass() {