1
0
mirror of synced 2024-11-22 13:06:02 +03:00

Update Alpine script

- Restart ipsec service on failure on Alpine Linux.
  Ref: 7f2fa159a7
- Cleanup
This commit is contained in:
hwdsl2 2022-04-17 15:25:20 -05:00
parent a52a02cf92
commit 15d8651f08

View File

@ -498,13 +498,24 @@ start_services() {
bigecho "Starting services..." bigecho "Starting services..."
sysctl -e -q -p sysctl -e -q -p
chmod +x /etc/rc.local
chmod 600 /etc/ipsec.secrets* /etc/ppp/chap-secrets* /etc/ipsec.d/passwd* chmod 600 /etc/ipsec.secrets* /etc/ppp/chap-secrets* /etc/ipsec.d/passwd*
mkdir -p /run/pluto mkdir -p /run/pluto
service fail2ban restart >/dev/null 2>&1 service fail2ban restart >/dev/null 2>&1
service ipsec restart >/dev/null 2>&1 service ipsec restart >/dev/null 2>&1
service xl2tpd restart >/dev/null 2>&1 service xl2tpd restart >/dev/null 2>&1
mkdir -p /etc/crontabs
cron_cmd="rc-service -c ipsec zap start"
if ! grep -qs "$cron_cmd" /etc/crontabs/root; then
cat >> /etc/crontabs/root <<EOF
* * * * * $cron_cmd
* * * * * sleep 15; $cron_cmd
* * * * * sleep 30; $cron_cmd
* * * * * sleep 45; $cron_cmd
EOF
touch /etc/crontabs/cron.update
fi
} }
show_vpn_info() { show_vpn_info() {