diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2011-05-27 10:26:10 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2011-05-27 10:26:10 -0300 |
commit | 733df1aa85e7cc0ccd23624c071387617053f049 (patch) | |
tree | c3397283f59d3cd09368cef903c449d0029e0c65 /share | |
parent | 56cc3ab078158f596d0cd4fc5152e113e58fc6f7 (diff) | |
download | keyringer-733df1aa85e7cc0ccd23624c071387617053f049.tar.gz keyringer-733df1aa85e7cc0ccd23624c071387617053f049.tar.bz2 |
Action recrypt now can re-encrypt the whole repository
Diffstat (limited to 'share')
-rwxr-xr-x | share/keyringer/recrypt | 20 |
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 |