case structure
This commit is contained in:
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user