From 9500da32313cac2c0f69f7dddb2fc74a4e0f9bde Mon Sep 17 00:00:00 2001 From: hwdsl2 Date: Fri, 6 Jan 2017 00:51:59 -0600 Subject: [PATCH] Bugfix - Fix commit ca84aa7 to avoid a possible race condition when starting ipsec and xl2tpd services on boot --- vpnsetup.sh | 4 ++-- vpnsetup_centos.sh | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/vpnsetup.sh b/vpnsetup.sh index e8692bc..bc5738c 100755 --- a/vpnsetup.sh +++ b/vpnsetup.sh @@ -401,8 +401,8 @@ if ! grep -qs "hwdsl2 VPN script" /etc/rc.local; then cat >> /etc/rc.local <<'EOF' # Added by hwdsl2 VPN script -service ipsec restart -service xl2tpd restart +service ipsec start +service xl2tpd start echo 1 > /proc/sys/net/ipv4/ip_forward exit 0 EOF diff --git a/vpnsetup_centos.sh b/vpnsetup_centos.sh index dd9fd57..dee7c98 100755 --- a/vpnsetup_centos.sh +++ b/vpnsetup_centos.sh @@ -371,13 +371,12 @@ fi # Start services at boot if grep -qs "release 6" /etc/redhat-release; then - for svc in iptables fail2ban ipsec xl2tpd; do - chkconfig "$svc" on - done + chkconfig iptables on + chkconfig fail2ban on else systemctl --now mask firewalld yum -y install iptables-services || exiterr2 - systemctl enable iptables fail2ban ipsec xl2tpd >/dev/null 2>&1 + systemctl enable iptables fail2ban >/dev/null 2>&1 fi if ! grep -qs "hwdsl2 VPN script" /etc/rc.local; then if [ -f /etc/rc.local ]; then