copying from private repo

This commit is contained in:
Q
2024-11-26 20:09:34 +02:00
parent 045f87ed7e
commit 6245fbcba0
14 changed files with 784 additions and 0 deletions

31
files/gpg-decrypt Executable file
View File

@@ -0,0 +1,31 @@
#!/bin/bash
if [[ -z "$1" ]]; then
echo "File missing or use -"
exit 1
fi
if [[ "$1" = "-" ]]; then
pv "$1" | gpg -d
exit $?
fi
if [[ -e "${1%.gpg}" ]]; then
echo "Target already exists"
exit 1
fi
echo Creating "${1%.gpg}"
if [[ -z "$GPGPASS" ]]; then
pv "$1" | gpg -d -o "${1%.gpg}" || {
echo ""
echo "If agent doesnt work, then:"
echo "Give password with env GPGPASS ( GPGPASS=secret gpg-decrypt $1 )"
}
else
{
echo "$GPGPASS";
pv "$1";
} | \
gpg -o "${1%.gpg}" -d --passphrase-fd 0 --batch --yes
fi