Files
blackbox/bin/blackbox_edit

26 lines
532 B
Plaintext
Raw Normal View History

2014-09-04 11:29:23 -03:00
#!/usr/bin/env bash
#
# blackbox_edit.sh -- Decrypt a file temporarily for edition, then re-encrypts it again
#
2014-09-08 20:25:38 +00:00
set -e
2014-09-04 11:29:23 -03:00
. _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
2014-09-04 11:29:23 -03:00
fi
blackbox_edit_start "$param"
$EDITOR $(get_unencrypted_filename $param)
blackbox_edit_end "$param"
2014-09-04 11:29:23 -03:00
done