diff --git a/bin/update_sops.sh b/bin/update_sops.sh index bf8889b..5385a22 100755 --- a/bin/update_sops.sh +++ b/bin/update_sops.sh @@ -2,8 +2,8 @@ # Purpose: manage .sops.yaml based on gpg keys in the same dir _and_ verify correct configuration set -euo pipefail -sops_config_dir="$(realpath "${1?"E: specify dir containing .sops.yaml"}")"; shift; keyfiles_dir="$(realpath "${1?"E: specify dir containing keyfiles"}")"; shift; +sops_config_dir="$(realpath "${1?"E: specify dir containing .sops.yaml"}")"; shift; sops_config="${sops_config_dir}/.sops.yaml" secrets_file="${1:-0}" @@ -82,10 +82,7 @@ fn_verify_sops_config(){ GPG_TTY=$(tty) sops -d "${sops_enc_file}" } if [[ "${secrets_file}" != "0" ]]; then - 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 echo "# WARN: no secrets file passed in, make sure to call 'sops updatekeys' on secrets files" diff --git a/example/cmd_sops.sh b/example/cmd_sops.sh index bbba293..9e25aa9 100755 --- a/example/cmd_sops.sh +++ b/example/cmd_sops.sh @@ -15,4 +15,4 @@ secrets_file="mock_secrets.yaml" # ./bin/update_sops.sh "${curdir}" "${PWD}"/ set -x -../bin/update_sops.sh "${sops_cfg_dir}" "${keys_dir}"/ "${secrets_file}" +../bin/update_sops.sh "${keys_dir}" "${sops_cfg_dir}" "${secrets_file}"