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

15 lines
365 B
Python
Executable File

#!/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")
if os.environ["TLS_FLAVOR"] in [ "letsencrypt","mail-letsencrypt" ]:
subprocess.Popen(["/letsencrypt.py"])
subprocess.call(["/config.py"])
os.execv("/usr/sbin/nginx", ["nginx", "-g", "daemon off;"])