Initial check in

This commit is contained in:
Tom Limoncelli
2014-07-07 20:30:16 -04:00
committed by tlimoncelli@stackexchange.com
parent e9a5bfab26
commit 73396c8a4d
8 changed files with 433 additions and 1 deletions

29
bin/blackbox_edit_start.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/bash
#
# blackbox_edit_start.sh -- Decrypt a file for editing.
#
source bin/blackbox_common.sh
set -e
fail_if_bad_environment
for param in """$@""" ; do
unencrypted_file=$(get_unencrypted_filename "$param")
encrypted_file=$(get_encrypted_filename "$param")
echo ========== PLAINFILE "$unencrypted_file"
fail_if_not_on_cryptlist "$unencrypted_file"
fail_if_not_exists "$encrypted_file" "This should not happen."
if [[ ! -s "$unencrypted_file" ]]; then
rm -f "$unencrypted_file"
fi
if [[ -f "$unencrypted_file" ]]; then
echo SKIPPING: "$1" "Will not overwrite non-empty files."
continue
fi
prepare_keychain
decrypt_file "$encrypted_file" "$unencrypted_file"
done