Created
August 7, 2017 18:05
-
-
Save stekan/a1adc322157b9af5e0dcc3142bb4b90f to your computer and use it in GitHub Desktop.
Find gpg email and decrypt
This file contains hidden or 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 | |
SRC=/path/to/eml/src | |
SAVEIFS=$IFS | |
IFS=$(echo -en "\n\b") | |
cd "$SRC" | |
for file in $(find -type f -name "*.eml" -exec grep -l "BEGIN\ PGP\ MESSAGE" {} \; -print) | |
do | |
gpg --decrypt --batch --no-tty --output "$(echo $file|sed 's/\.[^.]*$//').decrypted.eml" "$file" | |
done | |
IFS=$SAVEIFS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment