Files
blackbox/bin/blackbox_shred_all_files
tlimoncelli@stackexchange.com 0fb0c0c5dd Fix perms
2014-10-29 14:16:47 -04:00

24 lines
641 B
Bash
Executable File

#!/usr/bin/env bash
#
# blackbox_shred_all_files -- shred all decrypted versions of encrypted files
#
# 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
. _blackbox_common.sh
echo '========== FILES BEING SHREDDED:'
for i in $(<$BB_FILES) ; do
unencrypted_file=$(get_unencrypted_filename "$i")
encrypted_file=$(get_encrypted_filename "$i")
if [[ -f "$unencrypted_file" ]]; then
echo " $unencrypted_file"
shred_file "$unencrypted_file"
fi
done
echo '========== DONE.'