diff --git a/contrib/pa-pass b/contrib/pa-pass index 8377483..05a5740 100755 --- a/contrib/pa-pass +++ b/contrib/pa-pass @@ -2,8 +2,8 @@ # # migrate passwords from pass to pa # -# Password dir of pass: export PASSWORD_STORE_DIR=~/.password-store -# Password dir of pa: export PA_DIR=~/.local/share/pa/passwords +# password dir of pass: export PASSWORD_STORE_DIR=~/.password-store +# password dir of pa: export PA_DIR=~/.local/share/pa/passwords : "${PASSWORD_STORE_DIR:=$HOME/.password-store}" basedir=${XDG_DATA_HOME:=$HOME/.local/share}/pa @@ -19,7 +19,7 @@ find "$PASSWORD_STORE_DIR" -name '*.gpg' | while read -r passfile; do mkdir -p "$PA_DIR/$(dirname "./$name")" gpg2 -d "$passfile" | $age -R "$basedir/recipients" -o "$PA_DIR/$name.age" && - printf '%s\n' "Saved '$name' to the store." + printf '%s\n' "saved '$name' to the store." done if [ -z "${PA_NOGIT+x}" ] && command -v git >/dev/null 2>&1; then diff --git a/contrib/pa-rekey b/contrib/pa-rekey index 24730bc..bff56f3 100755 --- a/contrib/pa-rekey +++ b/contrib/pa-rekey @@ -23,18 +23,18 @@ basedir=${XDG_DATA_HOME:=$HOME/.local/share}/pa : "${PA_DIR:=$basedir/passwords}" realstore=$(realpath "$PA_DIR") || - die "Couldn't get path to password directory" + die "couldn't get path to password directory" tmpdir=$basedir/tmp mkdir "$tmpdir" || - die "Couldn't create temporary directory" + die "couldn't create temporary directory" trap 'rm -rf "$tmpdir"; exit' EXIT trap 'rm -rf "$tmpdir"; trap - INT; kill -s INT 0' INT cp -Rp "$realstore" "$tmpdir/passwords" || - die "Couldn't copy password directory" + die "couldn't copy password directory" # Remove git repository for forward secrecy. rm -rf "$tmpdir/passwords/.git" @@ -48,13 +48,13 @@ $age_keygen -y "$tmpdir/identities" >>"$tmpdir/recipients" 2>/dev/null pa l | while read -r name; do pa s "$name" | $age -R "$tmpdir/recipients" -o "$tmpdir/passwords/$name.age" || - die "Couldn't encrypt $name.age" + die "couldn't encrypt $name.age" done trap - INT EXIT rm -rf "$realstore" || - die "Couldn't remove password directory" + die "couldn't remove password directory" mv "$tmpdir/passwords" "$realstore" mv "$tmpdir/identities" "$(realpath "$basedir/identities")" diff --git a/contrib/pa-urn b/contrib/pa-urn index 2170f3b..99f8c1e 100755 --- a/contrib/pa-urn +++ b/contrib/pa-urn @@ -40,31 +40,31 @@ basedir=${XDG_DATA_HOME:=$HOME/.local/share}/pa : "${PA_DIR:=$basedir/passwords}" dir=$(realpath "$PA_DIR") || - die "Couldn't get path to password directory" + die "couldn't get path to password directory" name=$(basename "$dir") if [ "$2" ]; then urn=$(realpath -- "$2") || - die "Couldn't get path to file '$2'" + die "couldn't get path to file '$2'" else urn=$(pwd)/$name.tar.age || - die "Couldn't get working directory" + die "couldn't get working directory" fi cd "$(dirname "$dir")" || - die "Couldn't change to parent of password directory" + die "couldn't change to parent of password directory" case $1 in c*) { create_tar "$name" | $age -R "$basedir/recipients" -o "$urn"; } && - printf '%s\n' "Store has been archived into $urn" + printf '%s\n' "store has been archived into $urn" ;; o*) [ -f "$urn" ] || - die "File '$urn' doesn't exist" + die "file '$urn' doesn't exist" { $age --decrypt -i "$basedir/identities" "$urn" | extract_tar; } && - printf '%s\n' "File has been extracted into $PA_DIR" + printf '%s\n' "file has been extracted into $PA_DIR" ;; *) usage ;; esac