blob: f4cc9deb66437ee5143a6668fa5d62dde9c1a1cb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#!/bin/bash
#
# Re-encrypt files to multiple recipients.
#
# Load functions
LIB="`dirname $0`/../../lib/keyringer/functions"
source "$LIB" || exit 1
function keyringer_recrypt {
# Get file
keyringer_get_file "$1"
# Recrypt
gpg --use-agent -d "$KEYDIR/$FILE" | gpg --use-agent --armor -e -s $(keyringer_recipients "$RECIPIENTS") > "$KEYDIR/$FILE"
}
if [ ! -z "$2" ]; then
keyringer_recrypt $2
else
cd $KEYDIR && find | grep -v '^.$' | while read file; do
if [ ! -d "$KEYDIR/$file" ]; then
keyringer_recrypt "$file"
fi
done
fi
|