aboutsummaryrefslogtreecommitdiffstats
path: root/gnupg/decrypt
blob: 57db255b2b8537b99ee38e2e4b51b8e1f0287099 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
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