summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/mw12
1 files changed, 3 insertions, 9 deletions
diff --git a/bin/mw b/bin/mw
index 2a63315..cdb7856 100755
--- a/bin/mw
+++ b/bin/mw
@@ -174,20 +174,14 @@ askinfo() {
hostname="${fulladdr#*@}"
login="${login:-$fulladdr}"
if [ -n "${password+x}" ]; then
- createpass
+ insertpass
else
getpass
fi
}
-createpass() {
- echo "$password" >"$PASSWORD_STORE_DIR/$passprefix$fulladdr"
- "$GPG" -qe $(printf -- " -r %s" $(cat "$PASSWORD_STORE_DIR/.gpg-id")) "$PASSWORD_STORE_DIR/$passprefix$fulladdr"
- case "$(uname)" in
- Darwin | *BSD) rm -P "$PASSWORD_STORE_DIR/$passprefix$fulladdr" ;;
- *) shred -u "$PASSWORD_STORE_DIR/$passprefix$fulladdr" ;;
- esac
- rm -f "$PASSWORD_STORE_DIR/$passprefix$fulladdr"
+insertpass() {
+ printf "%s" "$password" | pass insert -fe "$PASSWORD_STORE_DIR/$passprefix$fulladdr"
}
errorexit() {