1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-05-27 22:57:38 +02:00
Mailu/core/nginx/start.py

15 lines
342 B
Python
Raw Normal View History

2017-09-24 14:01:03 +02:00
#!/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")
2017-09-24 14:01:03 +02:00
if os.environ["TLS_FLAVOR"] == "letsencrypt":
subprocess.Popen(["/letsencrypt.py"])
subprocess.call(["/config.py"])
2017-09-24 14:01:03 +02:00
os.execv("/usr/sbin/nginx", ["nginx", "-g", "daemon off;"])