diff options
Diffstat (limited to 'secrets/ready.sh')
| -rwxr-xr-x | secrets/ready.sh | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/secrets/ready.sh b/secrets/ready.sh index dee2f86..2760ec4 100755 --- a/secrets/ready.sh +++ b/secrets/ready.sh @@ -6,15 +6,16 @@ if [[ "$#" -gt 0 && ("$1" == "-h" || "$1" == "--help") ]]; then cat <<EOF ready: Check if the secret management system is ready for use -Tests whether the age private key is properly configured and available -for secret operations. Exits with status 0 if ready, non-zero if not. +Ready means a store (buckets, or the old store) and an identity to read it +with: this machine's own (szecret enrol), or the old key. Exits with status 0 +if ready, non-zero if not. Usage: ready ready -h|--help The command will: -1. Check if the private key exists and is readable +1. Check for this machine's identity, or the old private key 2. Perform any necessary legacy key migration 3. Exit with appropriate status code @@ -27,5 +28,7 @@ this_dir="$(cd "$(dirname "$(realpath "$0")")" && pwd)" szecret_quiet=1 source "${this_dir}/common.sh" -private_key_is_setup - +if [[ -r "${identity}" ]]; then + exit 0 +fi +[[ -n "${store}" ]] && private_key_is_setup |
