diff --git a/bin/update_sops.sh b/bin/update_sops.sh index 1325dc2..22e0ec2 100755 --- a/bin/update_sops.sh +++ b/bin/update_sops.sh @@ -3,6 +3,7 @@ set -euo pipefail sops_config=".sops.yaml" +secrets_file="${1:-0}" function fn_extract_fpr(){ gpgkeyfile=$1;shift; @@ -76,6 +77,10 @@ fn_verify_sops_config(){ # dump secrets, GPG_TTY src: https://www.varokas.com/secrets-in-code-with-mozilla-sops/ GPG_TTY=$(tty) sops -d "${sops_enc_file}" } -fn_verify_sops_config __mock_secrets.yaml +if [[ "${secrets_file}" != "0" ]]; then + fn_verify_sops_config "${secrets_file}" -echo "# SUCESS: all users with keys in this dir should have functional keys" + 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" +fi diff --git a/example/cmd_sops.sh b/example/cmd_sops.sh new file mode 100755 index 0000000..4748246 --- /dev/null +++ b/example/cmd_sops.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +cd "$( dirname "${BASH_SOURCE[0]}")" + +../bin/update_sops.sh