From cd880e76c27200de92d9346df476910741849f72 Mon Sep 17 00:00:00 2001 From: mavenlink Date: Thu, 2 Oct 2014 17:02:20 -0700 Subject: [PATCH] add blackbox_shred_all_files that shreds decrypted versions of any encrypted file, this will discard current changes --- bin/blackbox_shred_all_files | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 bin/blackbox_shred_all_files diff --git a/bin/blackbox_shred_all_files b/bin/blackbox_shred_all_files new file mode 100755 index 0000000..8324ecf --- /dev/null +++ b/bin/blackbox_shred_all_files @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +# +# blackbox_shred_all_files -- shred all decrypted versions of encrypted files +# + +set -e +. _blackbox_common.sh + +echo '========== ENCRYPTED FILES THAT WERE UNLOCKED:' +awk <"$BB_FILES" '{ print " " $1 ".gpg" }' + +echo '========== FILES THAT WILL BE SHREDDED:' +need_warning=false +for i in $(<$BB_FILES) ; do + unencrypted_file=$(get_unencrypted_filename "$i") + encrypted_file=$(get_encrypted_filename "$i") + if [[ -f "$unencrypted_file" ]]; then + shred_file "$unencrypted_file" + fi +done + +echo '========== DONE.'