2023-11-19 21:16:32 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
## A script to decrypt and dump the passwords
|
|
|
|
## from passwordstore to a simple list.
|
|
|
|
|
|
|
|
prefix=${PASSWORD_STORE_DIR:=~/.password-store}
|
|
|
|
|
|
|
|
## Set the IFS to account for spaces in filenames
|
|
|
|
IFS=$(echo -en "\n\b")
|
|
|
|
|
|
|
|
for file in $(find $prefix -name '*.gpg')
|
|
|
|
do
|
2023-11-19 21:26:48 +01:00
|
|
|
nicename=$(echo $file \
|
|
|
|
| cut --characters ${#prefix}- \
|
|
|
|
| cut --characters 3- \
|
|
|
|
| rev | cut --characters 5- | rev
|
|
|
|
)
|
2023-11-19 21:16:32 +01:00
|
|
|
echo " # "$nicename
|
|
|
|
gpg --quiet --decrypt $file | head -n 1
|
|
|
|
done
|