Files
blackbox/bin/blackbox_shred_all_files

36 lines
1.0 KiB
Plaintext
Raw Normal View History

#!/usr/bin/env bash
#
# blackbox_shred_all_files -- shred all decrypted versions of encrypted files
#
2014-10-30 14:14:12 +00:00
# Shred: To securely delete a file.
#
# Typical uses:
# After running blackbox_edit_start, deciding not to edit the file.
# A developer that wants to securely clean up a workspace before deleting it.
# An automated process that doesn't want to leave
# plaintext (unencrypted) files laying around.
#
2014-10-29 14:16:47 -04:00
# NOTE: The output lists files that were decrypted and are being
# shredded. For example, if you have many encrypted files but none
# have been decrypted for editing, you will see an empty list.
set -e
source "${0%/*}/_blackbox_common.sh"
change_to_vcs_root
2014-10-29 14:16:47 -04:00
echo '========== FILES BEING SHREDDED:'
2016-05-17 12:58:13 -04:00
while IFS= read <&99 -r encodedname; do
local name
name=$(echo $encodedname)
unencrypted_file=$(get_unencrypted_filename "$name")
encrypted_file=$(get_encrypted_filename "$name")
if [[ -f "$unencrypted_file" ]]; then
echo " $unencrypted_file"
shred_file "$unencrypted_file"
fi
done 99<"$BB_FILES"
echo '========== DONE.'