Files

9 lines
407 B
Bash
Executable File

#!/bin/sh
# Start the per-session router from the launcher's config in /etc/router.
set -eu
resolver=$(awk '/^nameserver/ {print $2; exit}' /etc/resolv.conf)
sed "s/@RESOLVER@/$resolver/" /etc/router/nginx.conf >/tmp/nginx.conf
dnsmasq --conf-file=/etc/router/dnsmasq.conf
# ponytail: no supervisor; if dnsmasq dies the session loses DNS, restart the session.
exec nginx -c /tmp/nginx.conf -g 'daemon off;'