2024-05-15 13:53:10 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
uki="$3"
|
|
|
|
[[ -n "$uki" ]] || exit 0
|
|
|
|
|
2024-09-04 16:05:12 +00:00
|
|
|
keypairs=(/var/lib/sbctl/keys/db/db.key /var/lib/sbctl/keys/db/db.pem)
|
2024-05-15 13:53:10 +00:00
|
|
|
|
|
|
|
for (( i=0; i<${#keypairs[@]}; i+=2 )); do
|
|
|
|
key="${keypairs[$i]}"
|
|
|
|
cert="${keypairs[(( i + 1))]}"
|
|
|
|
if ! sbverify --cert "$cert" "$uki" &>/dev/null; then
|
|
|
|
sbsign --key "$key" --cert "$cert" --output "$uki" "$uki"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|