From d0c754055ddfcc56feae567b16b9044baada1386 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 26 Jun 2021 20:04:40 +0200 Subject: Add e, ge, decrypt, encrypt, and encrypt-nosign MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- gnupg/decrypt | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 gnupg/decrypt (limited to 'gnupg/decrypt') diff --git a/gnupg/decrypt b/gnupg/decrypt new file mode 100755 index 0000000..57db255 --- /dev/null +++ b/gnupg/decrypt @@ -0,0 +1,13 @@ +#!/bin/dash +if test -z "${GPG_KEY}"; then + printf '\033[1;31m%s\033[0m\n' 'You must export GPG_KEY with you GPG key' >&2 + exit 1 +else + for file in "$@"; do + if test "${file}" = "${file%*.crypt}"; then + gpg --decrypt < "${file}" > "${file%*.crypt}" + else + gpg --decrypt < "${file}" > "${file}.decrypted" + fi + done +fi -- cgit v1.2.3-70-g09d2