Files
blackbox/bin/blackbox_start
tlimoncelli@stackexchange.com 28bff4ff9f Add "set -e" to all scripts.
2014-09-08 20:25:38 +00:00

21 lines
466 B
Bash
Executable File

#!/usr/bin/env bash
#
# blackbox_edit_start.sh -- Decrypt a file for editing.
#
set -e
. _blackbox_common.sh
for param in """$@""" ; do
unencrypted_file=$(get_unencrypted_filename "$param")
encrypted_file=$(get_encrypted_filename "$param")
fail_if_not_on_cryptlist "$unencrypted_file"
fail_if_not_exists "$encrypted_file" "This should not happen."
rm -f "$unencrypted_file"
prepare_keychain
decrypt_file "$encrypted_file" "$unencrypted_file"
done