mirror of
https://github.com/Mailu/Mailu.git
synced 2025-06-06 23:36:26 +02:00
13 lines
361 B
Python
13 lines
361 B
Python
|
#!/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
|
||
|
os.environ["ADMIN_ADDRESS"] = socket.gethostbyname("admin")
|
||
|
convert("/conf/nginx.conf", "/etc/nginx/nginx.conf")
|
||
|
os.execv("/usr/sbin/nginx", ["nginx", "-g", "daemon off;"])
|