10 lines
533 B
Bash
10 lines
533 B
Bash
#!/bin/sh
|
|
# Operator step after EVERY OpenBao restart (the vault starts sealed). Needs any 2 of the 3 shares.
|
|
set -eu
|
|
cd "$(dirname "$0")/.."; . scripts/bao_lib.sh
|
|
for i in 1 2 3; do
|
|
baoc status -format=json 2>/dev/null | grep -q "\"sealed\": false" && { echo "OpenBao unsealed"; exit 0; }
|
|
[ -f "$OPD/unseal-$i" ] && baoc operator unseal "$(cat "$OPD/unseal-$i")" >/dev/null
|
|
done
|
|
baoc status -format=json 2>/dev/null | grep -q "\"sealed\": false" && echo "OpenBao unsealed" || { echo "still sealed: need 2 shares" >&2; exit 1; }
|