diff options
Diffstat (limited to 'share/keyringer/encrypt-batch')
-rwxr-xr-x[l---------] | share/keyringer/encrypt-batch | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/share/keyringer/encrypt-batch b/share/keyringer/encrypt-batch index 8267197..915af3c 120000..100755 --- a/share/keyringer/encrypt-batch +++ b/share/keyringer/encrypt-batch @@ -1 +1,26 @@ -encrypt
\ No newline at end of file +#!/bin/bash +# +# Encrypt files to multiple recipients. +# + +# Load functions +LIB="`dirname $0`/../../lib/bash/functions" +source "$LIB" || exit 1 + +# Aditional parameters +keyringer_get_new_file "$2" + +# Encrypt +mkdir -p "$KEYDIR/`dirname $FILE`" + +if [ "$BASENAME" == "encrypt" ]; then + # Only display directions if we're running encrypt, not encrypt-batch + echo "Type your message and finish your input with EOF (Ctrl-D)." +fi + +gpg --use-agent --armor -e -s $(keyringer_recipients "$RECIPIENTS") - > "$KEYDIR/$FILE" + +# Stage +if [ -d "$BASEDIR/.git" ]; then + keyringer_exec git "$BASEDIR" add "keys/$FILE" +fi |