Bläddra i källkod

pipe password directly to pass

- also change slightly confusing naming for (re)inserting given
      passwords to pass store
pull/953/head
Tomáš Faikl (astro) 1 år sedan
förälder
incheckning
268da5d51b
1 ändrade filer med 3 tillägg och 9 borttagningar
  1. +3
    -9
      bin/mw

+ 3
- 9
bin/mw Visa fil

@@ -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() {


Laddar…
Avbryt
Spara