aboutsummaryrefslogtreecommitdiffstats
path: root/gnupg/encrypt
diff options
context:
space:
mode:
Diffstat (limited to 'gnupg/encrypt')
-rwxr-xr-xgnupg/encrypt10
1 files changed, 10 insertions, 0 deletions
diff --git a/gnupg/encrypt b/gnupg/encrypt
new file mode 100755
index 0000000..e91190f
--- /dev/null
+++ b/gnupg/encrypt
@@ -0,0 +1,10 @@
+#!/bin/dash
+if test -z "${GPG_KEY}"; then
+ printf '\033[1;34m%s\033[0m\n' 'You must export GPG_KEY with you GPG key' >&2
+ exit 1
+else
+ for file in "$@"; do
+ gpg --encrypt --sign -r "${GPG_KEY}" -u "${GPG_KEY}" < "${file}" > "${file}.crypt"
+ done
+ printf '\033[1;34m%s\033[0m\n' '-- Do not forget to shred. --' >&2
+fi