From c49d549ad6c6ceb4594c911f20e198083de3685b Mon Sep 17 00:00:00 2001 From: LeeW Date: Fri, 31 Jan 2025 14:16:04 +0100 Subject: [PATCH] phase1: update script, reduce noise on tty --- bin/update_sops.sh | 7 ++++--- example/cmd_sops.sh | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/update_sops.sh b/bin/update_sops.sh index 718c136..645b7fa 100755 --- a/bin/update_sops.sh +++ b/bin/update_sops.sh @@ -64,9 +64,9 @@ EOM } # UPDATE SOPS CONFIG -pushd "${keyfiles_dir}" +pushd "${keyfiles_dir}" > /dev/null 2>&1 (fn_update_sops_config) > "${sops_config}" -popd +popd > /dev/null 2>&1 # VERIFY fn_verify_sops_config(){ @@ -82,8 +82,9 @@ fn_verify_sops_config(){ GPG_TTY=$(tty) sops -d "${sops_enc_file}" } if [[ "${secrets_file}" != "0" ]]; then - pushd "${sops_config_dir}" + pushd "${sops_config_dir}" > /dev/null 2>&1 fn_verify_sops_config "${secrets_file}" + popd > /dev/null 2>&1 echo "# SUCESS: all users with keys in this dir should have functional keys" else diff --git a/example/cmd_sops.sh b/example/cmd_sops.sh index 10c5c99..d0286ed 100755 --- a/example/cmd_sops.sh +++ b/example/cmd_sops.sh @@ -6,4 +6,5 @@ cd "$( dirname "${BASH_SOURCE[0]}")/.." # ./bin/update_sops.sh "${curdir}" "${PWD}"/ +set -x ./bin/update_sops.sh "${curdir}" "${PWD}"/ "${curdir}/mock_secrets.yaml"