[IMP] script nginx certbot support admin email with non-interactive
This commit is contained in:
parent
a74a19f71e
commit
86d14cf244
1 changed files with 14 additions and 1 deletions
|
|
@ -51,6 +51,10 @@ def get_config():
|
|||
required=True,
|
||||
help="Separate by ; for multiple domains. Main domain is first on the list.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--admin_email",
|
||||
help="Will configure certbot with admin email to receive information about the certificate.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--odoo_version",
|
||||
default="18.0",
|
||||
|
|
@ -131,7 +135,16 @@ def main():
|
|||
if config.generate_nginx:
|
||||
time.sleep(10)
|
||||
cmd_lst_domain = " -d " + " -d ".join(lst_domain)
|
||||
cmd_certbot = "sudo certbot --nginx%s" % cmd_lst_domain
|
||||
cmd_more_certbot_cmd = ""
|
||||
|
||||
if config.admin_email:
|
||||
cmd_more_certbot_cmd += (
|
||||
f"--email {config.admin_email} --non-interactive --agree-tos "
|
||||
)
|
||||
|
||||
cmd_certbot = (
|
||||
f"sudo certbot {cmd_more_certbot_cmd}--nginx{cmd_lst_domain}"
|
||||
)
|
||||
print(cmd_certbot)
|
||||
os.system(cmd_certbot)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue