summaryrefslogtreecommitdiff
path: root/src/password-store.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/password-store.sh')
-rwxr-xr-xsrc/password-store.sh19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index 503bac4..e4e622e 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -119,7 +119,6 @@ tmpdir() {
fi
}
-GPG="gpg"
GETOPT="getopt"
# source /path/to/platform-defined-functions
@@ -160,7 +159,7 @@ case "$command" in
if [[ $reencrypt -eq 1 ]]; then
find "$PREFIX" -iname '*.gpg' | while read passfile; do
- $GPG -d $GPG_OPTS "$passfile" | $GPG -e -r "$gpg_id" -o "$passfile.new" $GPG_OPTS &&
+ gpg2 -d $GPG_OPTS "$passfile" | gpg2 -e -r "$gpg_id" -o "$passfile.new" $GPG_OPTS &&
mv -v "$passfile.new" "$passfile"
done
git_add_file "$PREFIX" "Reencrypted entire store using new GPG id $gpg_id."
@@ -222,9 +221,9 @@ case "$command" in
exit 1
fi
if [[ $clip -eq 0 ]]; then
- exec $GPG -d $GPG_OPTS "$passfile"
+ exec gpg2 -d $GPG_OPTS "$passfile"
else
- clip "$($GPG -d $GPG_OPTS "$passfile" | head -n 1)" "$path"
+ clip "$(gpg2 -d $GPG_OPTS "$passfile" | head -n 1)" "$path"
fi
fi
;;
@@ -257,7 +256,7 @@ case "$command" in
if [[ $multiline -eq 1 ]]; then
echo "Enter contents of $path and press Ctrl+D when finished:"
echo
- $GPG -e -r "$ID" -o "$passfile" $GPG_OPTS
+ gpg2 -e -r "$ID" -o "$passfile" $GPG_OPTS
elif [[ $noecho -eq 1 ]]; then
while true; do
read -p "Enter password for $path: " -s password
@@ -265,7 +264,7 @@ case "$command" in
read -p "Retype password for $path: " -s password_again
echo
if [[ $password == $password_again ]]; then
- $GPG -e -r "$ID" -o "$passfile" $GPG_OPTS <<<"$password"
+ gpg2 -e -r "$ID" -o "$passfile" $GPG_OPTS <<<"$password"
break
else
echo "Error: the entered passwords do not match."
@@ -273,7 +272,7 @@ case "$command" in
done
else
read -p "Enter password for $path: " -e password
- $GPG -e -r "$ID" -o "$passfile" $GPG_OPTS <<<"$password"
+ gpg2 -e -r "$ID" -o "$passfile" $GPG_OPTS <<<"$password"
fi
git_add_file "$passfile" "Added given password for $path to store."
;;
@@ -295,11 +294,11 @@ case "$command" in
action="Added"
if [[ -f $passfile ]]; then
- $GPG -d -o "$tmp_file" $GPG_OPTS "$passfile" || exit 1
+ gpg2 -d -o "$tmp_file" $GPG_OPTS "$passfile" || exit 1
action="Edited"
fi
${EDITOR:-vi} "$tmp_file"
- while ! $GPG -e -r "$ID" -o "$passfile" $GPG_OPTS "$tmp_file"; do
+ while ! gpg2 -e -r "$ID" -o "$passfile" $GPG_OPTS "$tmp_file"; do
echo "GPG encryption failed. Retrying."
sleep 1
done
@@ -337,7 +336,7 @@ case "$command" in
pass="$(pwgen -s $symbols $length 1)"
[[ -n $pass ]] || exit 1
- $GPG -e -r "$ID" -o "$passfile" $GPG_OPTS <<<"$pass"
+ gpg2 -e -r "$ID" -o "$passfile" $GPG_OPTS <<<"$pass"
git_add_file "$passfile" "Added generated password for $path to store."
if [[ $clip -eq 0 ]]; then
ass='logmsg'> 2020-05-10Fix building cacheRené 'Necoro' Neumann1-1/+3 2020-05-10Update READMERené 'Necoro' Neumann1-5/+44 2020-05-10Ignore 'dist' folder and build productsRené 'Necoro' Neumann1-0/+2 2020-05-08Print item hashes in debug modeRené 'Necoro' Neumann1-1/+7 2020-05-07Improve html renderingRené 'Necoro' Neumann2-53/+32 2020-05-07Do not assume items to be new when their published date is newer than the ↵René 'Necoro' Neumann2-7/+1 last run 2020-05-07Updating some depsRené 'Necoro' Neumann2-2/+7 2020-05-07Better detection if a text starts with html or notRené 'Necoro' Neumann2-4/+13 2020-05-07go fmtRené 'Necoro' Neumann1-3/+2 2020-05-07Add header X-Feed2Imap-GUIDRené 'Necoro' Neumann3-1/+7 2020-05-07update changelogRené 'Necoro' Neumann1-0/+1 2020-05-07FixRené 'Necoro' Neumann1-1/+1 2020-05-07Unified publishedDate and updatedDate into one (just as the old feed2imap...)René 'Necoro' Neumann5-21/+32 2020-05-06Print version during startupRené 'Necoro' Neumann1-1/+1 2020-05-06Improve templateRené 'Necoro' Neumann3-20/+28 2020-05-05Fix pipelineRené 'Necoro' Neumann1-2/+5 2020-05-05Make changelog a part of the release pipeline (untested)René 'Necoro' Neumann2-0/+12