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:-}/" \
/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 -o eth0 -j MASQUERADE
command=openvpn --config /run/openvpn.conf
command=openvpn --config /app/data/openvpn.conf
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