workspace/arch-user/bin/gpg/reencrypt-to-sym.sh
2025-04-20 21:36:44 +00:00

14 lines
305 B
Bash
Executable File

#!/bin/bash
set -e
if [ -z "$PASSPHRASE" ]; then
read -srp "Password: " PASSPHRASE
echo
fi
export PASSPHRASE
bash ~/.local/bin/alg/file-tree-apply.sh "$1" "$2" '*.gpg' \
'if [ ! -f "$2" ]; then gpg --decrypt "$1" | gpg --symmetric --output "$2" --passphrase "$PASSPHRASE" --batch --yes; fi'
echo ok