First try at auto-encrypting notes when encryption is turned on

This commit is contained in:
Jon-William Lewis
2016-02-16 11:45:11 -06:00
parent 6aad964a77
commit 9ceb05688e
2 changed files with 370 additions and 0 deletions

View File

@@ -20,5 +20,16 @@ if [ "$ENCRYPTION" == "TRUE" ]; then
>&2 printf " $RED_COLOR!$RESET_COLOR %s\n\t%s\n"\
"No GPG recipient was provided in $CONFIG_FILE. "
exit 110
else
cd "$NOTES_DIR"
find . -type f -name "*.$EXT" | grep -v "gpg" | while read TMP_NOTE; do
NOTE="${TMP_NOTE%.$EXT}.gpg.$EXT"
echo $NOTE
encrypt
if [ -r $NOTE ]; then
rm $TMP_NOTE
fi
done
fi
fi