1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-01-14 02:34:22 +02:00
Mailu/core/nginx/start.py
2018-10-31 19:17:23 +02:00

15 lines
366 B
Python
Executable File

#!/usr/bin/python3
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")
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;"])