2018-10-31 19:17:23 +02:00
|
|
|
#!/usr/bin/python3
|
2017-09-24 14:01:03 +02:00
|
|
|
|
|
|
|
import os
|
2017-09-24 17:50:10 +02:00
|
|
|
import subprocess
|
|
|
|
|
2017-12-03 12:28:26 +02:00
|
|
|
# Check if a stale pid file exists
|
2018-06-02 10:23:33 +02:00
|
|
|
if os.path.exists("/var/run/nginx.pid"):
|
|
|
|
os.remove("/var/run/nginx.pid")
|
2017-09-24 14:01:03 +02:00
|
|
|
|
2017-12-05 01:21:58 +02:00
|
|
|
if os.environ["TLS_FLAVOR"] in [ "letsencrypt","mail-letsencrypt" ]:
|
2017-09-24 17:50:10 +02:00
|
|
|
subprocess.Popen(["/letsencrypt.py"])
|
2018-12-06 17:48:26 +02:00
|
|
|
elif os.environ["TLS_FLAVOR"] in [ "mail", "cert" ]:
|
|
|
|
subprocess.Popen(["/certwatcher.py"])
|
2017-09-24 17:50:10 +02:00
|
|
|
|
|
|
|
subprocess.call(["/config.py"])
|
2017-09-24 14:01:03 +02:00
|
|
|
os.execv("/usr/sbin/nginx", ["nginx", "-g", "daemon off;"])
|