|
|
|
@ -146,6 +146,9 @@ function hide {
|
|
|
|
|
local recipients
|
|
|
|
|
recipients=$(_get_recipients)
|
|
|
|
|
|
|
|
|
|
local secrets_dir_keys
|
|
|
|
|
secrets_dir_keys=$(_get_secrets_dir_keys)
|
|
|
|
|
|
|
|
|
|
local input_path
|
|
|
|
|
local output_path
|
|
|
|
|
input_path=$(_append_root_path "$filename")
|
|
|
|
@ -156,10 +159,8 @@ function hide {
|
|
|
|
|
# encrypt file only if required
|
|
|
|
|
if [[ "$fsdb_file_hash" != "$file_hash" ]]; then
|
|
|
|
|
# shellcheck disable=2086
|
|
|
|
|
local secrets_dir_keys
|
|
|
|
|
secrets_dir_keys=$(_get_secrets_dir_keys)
|
|
|
|
|
$SECRETS_GPG_COMMAND --homedir "$secrets_dir_keys" "--no-permission-warning" --use-agent --yes --trust-model=always --encrypt \
|
|
|
|
|
$recipients -o "$output_path" "$input_path" > /dev/null 2>&1
|
|
|
|
|
"$recipients" -o "$output_path" "$input_path" > /dev/null 2>&1
|
|
|
|
|
local exit_code=$?
|
|
|
|
|
if [[ "$exit_code" -ne 0 ]]; then
|
|
|
|
|
_abort "problem encrypting file with gpg: exit code $exit_code: $filename"
|
|
|
|
|