Added EDITOR default to blackbox_edit; Created blackbox_view
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
# blackbox_edit.sh -- Decrypt a file temporarily for edition, then re-encrypts it again
|
# blackbox_edit.sh -- Decrypt a file temporarily for edition, then re-encrypts it again
|
||||||
#
|
#
|
||||||
set -e
|
set -e
|
||||||
|
[ -z $EDITOR ] && EDITOR="vi"
|
||||||
blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||||
source ${blackbox_home}/_blackbox_common.sh
|
source ${blackbox_home}/_blackbox_common.sh
|
||||||
|
|
||||||
|
|||||||
28
bin/blackbox_view
Executable file
28
bin/blackbox_view
Executable file
@@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
#
|
||||||
|
# blackbox_edit.sh -- Decrypt a file temporarily for edition, then re-encrypts it again
|
||||||
|
#
|
||||||
|
set -e
|
||||||
|
[ -z $EDITOR ] && EDITOR="vi"
|
||||||
|
blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||||
|
source ${blackbox_home}/_blackbox_common.sh
|
||||||
|
|
||||||
|
for param in """$@""" ; do
|
||||||
|
unencrypted_file=$(get_unencrypted_filename "$param")
|
||||||
|
if ! is_on_cryptlist "$param" && ! is_on_cryptlist "$unencrypted_file" ; then
|
||||||
|
read -r -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 $(get_unencrypted_filename $param)
|
||||||
|
rm -f "$param"
|
||||||
|
done
|
||||||
Reference in New Issue
Block a user