From fc6198e7dc708aa5abc3a393e55a9f90bbf0f4d3 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Fri, 18 Oct 2019 10:21:59 -0400 Subject: [PATCH] fix variable bugs --- vpn-server-setup | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/vpn-server-setup b/vpn-server-setup index a311ba8..1224ff2 100755 --- a/vpn-server-setup +++ b/vpn-server-setup @@ -193,11 +193,17 @@ push "dhcp-option DNS 10.8.0.1" EOF fi -if $ip6; then +if [[ $ip6 ]]; then cat >>$server_dir/server.conf <>/etc/sysctl.conf <<'EOF' +net.ipv6.conf.all.forwarding=1 +EOF + fi @@ -206,7 +212,7 @@ if $route; then # Be the default gateway for clients. push "redirect-gateway def1" EOF - if $ip6; then + if [[ $ip6 ]]; then cat >>$server_dir/server.conf <<'EOF' push "route-ipv6 2000::/3" EOF @@ -214,10 +220,8 @@ EOF fi sed -i --follow-symlinks '/^ *net\.ipv4\.ip_forward=.*/d' /etc/sysctl.conf -sed -i --follow-symlinks '/^ *net.ipv6.conf.all.forwarding=.*/d' /etc/sysctl.conf cat >>/etc/sysctl.conf <<'EOF' net.ipv4.ip_forward=1 -net.ipv6.conf.all.forwarding=1 EOF sysctl -p /etc/sysctl.conf -- 2.30.2