summaryrefslogtreecommitdiff
path: root/secrets/ready.sh
diff options
context:
space:
mode:
Diffstat (limited to 'secrets/ready.sh')
-rwxr-xr-xsecrets/ready.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/secrets/ready.sh b/secrets/ready.sh
new file mode 100755
index 0000000..dee2f86
--- /dev/null
+++ b/secrets/ready.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+set -euo pipefail
+
+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.
+
+Usage:
+ ready
+ ready -h|--help
+
+The command will:
+1. Check if the private key exists and is readable
+2. Perform any necessary legacy key migration
+3. Exit with appropriate status code
+
+Note: Silent command, check exit status for result.
+EOF
+ exit 0
+fi
+
+this_dir="$(cd "$(dirname "$(realpath "$0")")" && pwd)"
+szecret_quiet=1
+source "${this_dir}/common.sh"
+
+private_key_is_setup
+