1
0
mirror of https://github.com/Mailu/Mailu.git synced 2024-12-14 10:53:30 +02:00
Mailu/core/nginx/start.py

17 lines
461 B
Python
Raw Normal View History

#!/usr/bin/python3
2017-09-24 14:01:03 +02:00
import os
import subprocess
# Check if a stale pid file exists
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" ]:
subprocess.Popen(["/letsencrypt.py"])
elif os.environ["TLS_FLAVOR"] in [ "mail", "cert" ]:
subprocess.Popen(["/certwatcher.py"])
subprocess.call(["/config.py"])
2017-09-24 14:01:03 +02:00
os.execv("/usr/sbin/nginx", ["nginx", "-g", "daemon off;"])