aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rwxr-xr-xshare/keyringer/recrypt20
1 files changed, 16 insertions, 4 deletions
diff --git a/share/keyringer/recrypt b/share/keyringer/recrypt
index a7607e0..f4cc9de 100755
--- a/share/keyringer/recrypt
+++ b/share/keyringer/recrypt
@@ -7,8 +7,20 @@
LIB="`dirname $0`/../../lib/keyringer/functions"
source "$LIB" || exit 1
-# Get file
-keyringer_get_file "$2"
+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"
+ # 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