summaryrefslogtreecommitdiff
path: root/secrets/ready.sh
diff options
context:
space:
mode:
authorIgor Soarez <igor@soarez.org>2026-09-17 19:45:23 +0100
committerIgor Soarez <igor@soarez.org>2026-09-17 19:45:23 +0100
commit13cc065ec014b86369dfe4ad60d1a43fa06fd251 (patch)
tree684690c61b7b59758c2aac132c65b81c86de0608 /secrets/ready.sh
dotfiles
Shell, editor and terminal configuration, the tools that go with them, and szecret, an age-based secret manager whose store lives elsewhere. History restarts here. What came before was not written to be read by anyone else, and carried machine names, addresses and an encrypted secret store; it is kept privately instead. What is left is meant to be safe on any machine, including one whose owner is not me: see CLAUDE.md for the rule it is written to.
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
+