From 62fa5fa2d2cf29d3761e060b49ee1490739c7b91 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 8 Oct 2009 16:47:03 -0300 Subject: Initial import --- scripts/recrypt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 scripts/recrypt (limited to 'scripts/recrypt') diff --git a/scripts/recrypt b/scripts/recrypt new file mode 100755 index 0000000..f2c8d6a --- /dev/null +++ b/scripts/recrypt @@ -0,0 +1,20 @@ +#!/bin/bash +# re-encrypt to multiple recipients + +FILE="$1" +BASENAME="`basename $0`" +RECIPIENTS="config/recipients" + +if [ -z "$FILE" ]; then + echo "Usage: `basename $0` " + exit 1 +elif [ ! -f "$RECIPIENTS" ]; then + echo "No recipient config was found" + exit 1 +elif [ ! -f "keys/$FILE" ]; then + echo "File not found" + exit 1 +fi + +recipients="$(awk '{ print "-r " $2 }' $RECIPIENTS | xargs)" +gpg -d keys/$FILE | gpg --armor -e -s $recipients > keys/$FILE -- cgit v1.2.3