You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
514 B
Python
19 lines
514 B
Python
#!/usr/bin/python
|
|
|
|
import os
|
|
import subprocess
|
|
|
|
# Check if a stale pid file exists
|
|
if os.path.exists("/var/log/nginx.pid"):
|
|
os.remove("/var/log/nginx.pid")
|
|
|
|
# Actual startup script
|
|
if not os.path.exists("/certs/dhparam.pem") and os.environ["TLS_FLAVOR"] != "notls":
|
|
os.system("openssl dhparam -out /certs/dhparam.pem 4096")
|
|
|
|
if os.environ["TLS_FLAVOR"] == "letsencrypt":
|
|
subprocess.Popen(["/letsencrypt.py"])
|
|
|
|
subprocess.call(["/config.py"])
|
|
os.execv("/usr/sbin/nginx", ["nginx", "-g", "daemon off;"])
|