diff options
author | Tomáš Faikl (astro) <tomasfaikl@seznam.cz> | 2023-07-26 01:38:52 +0200 |
---|---|---|
committer | Tomáš Faikl (astro) <tomasfaikl@seznam.cz> | 2023-07-26 09:05:20 +0200 |
commit | 268da5d51b1e710f244507296f911cd847fb8dbe (patch) | |
tree | 2164c389ba841b716557eca22d220edf798da943 | |
parent | bdce679540573963fb1ec8997baef70fe389fd24 (diff) |
pipe password directly to pass
- also change slightly confusing naming for (re)inserting given
passwords to pass store
-rwxr-xr-x | bin/mw | 12 |
1 files changed, 3 insertions, 9 deletions
@@ -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() { |