1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-03-03 14:52:36 +02:00
Mailu/nginx/start.py

14 lines
403 B
Python
Raw Normal View History

2017-09-24 14:01:03 +02:00
#!/usr/bin/python
import jinja2
import os
import socket
convert = lambda src, dst: open(dst, "w").write(jinja2.Template(open(src).read()).render(**os.environ))
# Actual startup script
if "ADMIN_ADDRESS" not in os.environ:
os.environ["ADMIN_ADDRESS"] = socket.gethostbyname("admin")
2017-09-24 14:01:03 +02:00
convert("/conf/nginx.conf", "/etc/nginx/nginx.conf")
os.execv("/usr/sbin/nginx", ["nginx", "-g", "daemon off;"])