diff options
author | Mattias Andrée <maandree@kth.se> | 2021-06-26 20:04:40 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-06-26 20:04:40 +0200 |
commit | d0c754055ddfcc56feae567b16b9044baada1386 (patch) | |
tree | 8d8e21d00daaa3e512c5e21d6e0c805ba212b409 /gnupg/decrypt | |
parent | Add the wrappers c, dmenu, mplayer, st, and aur (diff) | |
download | dotfiles-d0c754055ddfcc56feae567b16b9044baada1386.tar.gz dotfiles-d0c754055ddfcc56feae567b16b9044baada1386.tar.bz2 dotfiles-d0c754055ddfcc56feae567b16b9044baada1386.tar.xz |
Add e, ge, decrypt, encrypt, and encrypt-nosign
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rwxr-xr-x | gnupg/decrypt | 13 |
1 files changed, 13 insertions, 0 deletions
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 |