all repos — dot @ e01393235ef52fc05f2a4a3768f22e73eb12cd73

Shell, editor and terminal configuration, and the tools that go with them

secrets/ready.sh (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 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