From a75d12f964f0d3b77d041ef310c991631097ff0e Mon Sep 17 00:00:00 2001 From: "root@culturestrings" Date: Wed, 1 Jul 2020 09:16:56 +0000 Subject: openvpn: added $vpn_route_all support (yes/no). --- public/fs/etc/openvpn/hostvpn-conf.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'public/fs/etc/openvpn/hostvpn-conf.sh') diff --git a/public/fs/etc/openvpn/hostvpn-conf.sh b/public/fs/etc/openvpn/hostvpn-conf.sh index a438a54..24cb390 100755 --- a/public/fs/etc/openvpn/hostvpn-conf.sh +++ b/public/fs/etc/openvpn/hostvpn-conf.sh @@ -10,10 +10,17 @@ cfg_srcdir=$(cd -- "${cfg_script%/*}/" ; pwd -P) source /root/config/private/config/server.ports source /root/config/private/config/hostinfo/${sitezone} +if [ ${vpn_route_all} = 'yes' ]; then + vpn_route_all_subst='s/^@vpn_route_all@ //g' +else + vpn_route_all_subst='/^@vpn_route_all@ /d' +fi + sed -e 's/@vpn_port@/'${vpn_port}'/g' \ -e 's/@hostname@/'${hostname}'/g' \ -e 's/@vpn_net4@/'${vpn_net4}'/g' \ -e 's/@vpn_ipv4@/'${vpn_ipv4}'/g' \ -e 's/@host_ipv4@/'${host_ipv4}'/g' \ -e 's/@host_ipv6@/'${host_ipv6}'/g' \ + -e "${vpn_route_all_subst}" \ "${cfg_srcdir}/hostvpn.conf.in" -- cgit v1.2.3