summaryrefslogtreecommitdiff
path: root/renew-all
diff options
context:
space:
mode:
Diffstat (limited to 'renew-all')
-rwxr-xr-xrenew-all23
1 files changed, 15 insertions, 8 deletions
diff --git a/renew-all b/renew-all
index 05510fa..7be893e 100755
--- a/renew-all
+++ b/renew-all
@@ -10,6 +10,7 @@ import tomllib
parser = argparse.ArgumentParser()
parser.add_argument("--env", required=True, choices=["prod", "nonprod"])
+parser.add_argument("action", default="renew", nargs="?", choices=["renew", "run"])
args = parser.parse_args()
@@ -27,6 +28,19 @@ def main() -> None:
for subdomain in subdomain_list
for request in ("--domains", subdomain)
]
+ actions = {
+ "renew": [
+ "renew",
+ "--reuse-key",
+ "--days",
+ str(domain["renew_days"]),
+ "--renew-hook",
+ domain[f"renew_script_{args.env}"],
+ ],
+ "run": [
+ "run",
+ ],
+ }
command = (
[
"lego",
@@ -40,14 +54,7 @@ def main() -> None:
"--dns.disable-cp",
]
+ subdomain_requests
- + [
- "renew",
- "--reuse-key",
- "--days",
- str(domain["renew_days"]),
- "--renew-hook",
- domain[f"renew_script_{args.env}"],
- ]
+ + actions[args.action]
)
environment = {
"DESEC_POLLING_INTERVAL": str(config["timeout_seconds"]),