case structure

This commit is contained in:
John Lancaster
2026-03-16 08:37:40 -05:00
parent 2231c5910c
commit 3af6ab0819

View File

@@ -1,5 +1,6 @@
{ inputs, lib, ... }:
let
# Options that will be in common between
opts = {
enable = lib.mkEnableOption "Enable mTLS";
caURL = lib.mkOption {
@@ -110,18 +111,20 @@ let
echo "Renewing mTLS certificate"
else
rc=$?
if [ "$rc" -eq 1 ]; then
case "$rc" in
1)
echo "mTLS certificate does not need renewal"
exit 0
fi
if [ "$rc" -eq 2 ]; then
;;
2)
echo "mTLS certificate missing: ${tlsCert}" >&2
exit 1
fi
;;
*)
echo "step certificate needs-renewal failed with rc=$rc" >&2
exit "$rc"
;;
esac
fi
${lib.getExe pkgs.step-cli} ca renew --force "${tlsCert}" "${tlsKey}"