Commit 9eee404c authored by Girish Ramakrishnan's avatar Girish Ramakrishnan

Persist openvpn.conf

parent 6aa754b8
......@@ -39,9 +39,11 @@ echo "==> Creating CRL"
# Writing OpenVPN config
echo "==> Generating OpenVPN config"
sed -e "s/##VPN_TCP_PORT/${VPN_TCP_PORT:-}/" \
-e "s/##CLOUDRON_APP_DOMAIN/${CLOUDRON_APP_DOMAIN}/" \
/app/code/openvpn.conf.template > /run/openvpn.conf
[[ ! -f /app/data/openvpn.conf ]] && cp /app/code/openvpn.conf.template /app/data/openvpn.conf
sed -e "s/^port .*/port ${VPN_TCP_PORT:-}/" \
-e "s/^push \"dhcp-option DOMAIN .*\"/push \"dhcp-option DOMAIN ${CLOUDRON_APP_DOMAIN}\"/" \
-i /app/data/openvpn.conf
# Add iptables rules for NATing VPN traffic
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
......
[program:openvpn]
user=root
command=openvpn --config /run/openvpn.conf
command=openvpn --config /app/data/openvpn.conf
autostart=true
autorestart=true
; https://veithen.github.io/2015/01/08/supervisord-redirecting-stdout.html
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment