Skip to content

Instantly share code, notes, and snippets.

@FiloSottile

FiloSottile/pass-rekey.sh

Last active Aug 29, 2015
Embed
What would you like to do?
password-store rekey script
#! /bin/bash
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'
readonly PASSWORD_STORE=~/.password-store
relpath() {
python -c "import os.path; print os.path.relpath('$1','${2:-$PWD}')"
}
get_name() {
relpath "$1" "$PASSWORD_STORE" | sed 's/\.gpg$//'
}
for n in "$PASSWORD_STORE"/**/*.gpg; do
EDITOR=true pass edit $(get_name "$n")
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment