ionos_ddns_ssl_supervisor/scripts/ssl_update.py
2025-03-13 00:01:19 +08:00

13 lines
570 B
Python
Executable file

#!/usr/bin/env python3
#1 email
#2 domain
import subprocess
import sys
import time
import os
email = os.environ["EMAIL"]
domain = os.environ["DOMAIN"]
subprocess.call(["certbot", "certonly", "--non-interactive", "--email", email, "--authenticator", "dns-ionos", "--dns-ionos-credentials", "/secret/"+domain+".ini", "--dns-ionos-propagation-seconds", "60", "--server", "https://acme-v02.api.letsencrypt.org/directory", "--agree-tos", "--rsa-key-size", "4096", "-d", domain, "-d", "*."+domain])
while True:
time.sleep(23*60*60)
subprocess.call(["certbot","renew"])