Created
February 25, 2014 13:05
-
-
Save tfm/9208368 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
set -e | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
FILES=`find $1 -name "*gpg"` | |
echo "I am about to decrypt and re-encrypt the following files, with the current | |
set of public keys. | |
$FILES | |
Any existing plaintext in the checkout will be lost. Do you wish to continue? (y/n) " | |
read -n 1 -r | |
if [[ ! $REPLY =~ ^[Yy]$ ]] | |
then | |
printf '\n' | |
exit 0 | |
fi | |
for FILE in $FILES; | |
do | |
gpg --batch --skip-verify --yes $FILE | |
DECRYPTED=`echo $FILE | sed s/\.[^\.]*$//` | |
$DIR/encrypt $DECRYPTED | |
srm $DECRYPTED | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment