1
0
mirror of synced 2025-02-19 21:43:17 +03:00
- Fix commit ca84aa7 to avoid a possible race condition
  when starting ipsec and xl2tpd services on boot
This commit is contained in:
hwdsl2 2017-01-06 00:51:59 -06:00
parent ca84aa7a13
commit 9500da3231
2 changed files with 5 additions and 6 deletions

View File

@ -401,8 +401,8 @@ if ! grep -qs "hwdsl2 VPN script" /etc/rc.local; then
cat >> /etc/rc.local <<'EOF' cat >> /etc/rc.local <<'EOF'
# Added by hwdsl2 VPN script # Added by hwdsl2 VPN script
service ipsec restart service ipsec start
service xl2tpd restart service xl2tpd start
echo 1 > /proc/sys/net/ipv4/ip_forward echo 1 > /proc/sys/net/ipv4/ip_forward
exit 0 exit 0
EOF EOF

View File

@ -371,13 +371,12 @@ fi
# Start services at boot # Start services at boot
if grep -qs "release 6" /etc/redhat-release; then if grep -qs "release 6" /etc/redhat-release; then
for svc in iptables fail2ban ipsec xl2tpd; do chkconfig iptables on
chkconfig "$svc" on chkconfig fail2ban on
done
else else
systemctl --now mask firewalld systemctl --now mask firewalld
yum -y install iptables-services || exiterr2 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 fi
if ! grep -qs "hwdsl2 VPN script" /etc/rc.local; then if ! grep -qs "hwdsl2 VPN script" /etc/rc.local; then
if [ -f /etc/rc.local ]; then if [ -f /etc/rc.local ]; then