Files
blackbox/bin/blackbox_edit
tlimoncelli@stackexchange.com 2689a2d5a4 Remove debug statement
2014-09-09 20:36:27 +00:00

26 lines
515 B
Bash
Executable File

#!/usr/bin/env bash
#
# blackbox_edit.sh -- Decrypt a file temporarily for edition, then re-encrypts it again
#
set -e
. _blackbox_common.sh
for param in """$@""" ; do
if ! is_on_cryptlist "$param" ; then
read -p "Encrypt file $param? (y/n) " ans
case "$ans" in
y* | Y*)
blackbox_register_new_file "$param"
;;
*)
echo 'Skipping...'
continue
;;
esac
fi
blackbox_edit_start "$param"
$EDITOR $unencrypted_file
blackbox_edit_end "$param"
done