Improve services on boot
- Systemd may run rc.local early during system boot - Insert delay so that services can start correctly
This commit is contained in:
parent
5e3689198f
commit
cf595eaee7
@ -432,14 +432,12 @@ 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
|
||||||
|
(sleep 15
|
||||||
service ipsec start
|
service ipsec start
|
||||||
service xl2tpd start
|
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
|
||||||
if grep -qs raspbian /etc/os-release; then
|
|
||||||
sed --follow-symlinks -i '/hwdsl2 VPN script/a sleep 15' /etc/rc.local
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
bigecho "Starting services..."
|
bigecho "Starting services..."
|
||||||
|
@ -418,10 +418,11 @@ 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
|
||||||
|
(sleep 15
|
||||||
modprobe -q pppol2tp
|
modprobe -q pppol2tp
|
||||||
service ipsec restart
|
service ipsec restart
|
||||||
service xl2tpd restart
|
service xl2tpd restart
|
||||||
echo 1 > /proc/sys/net/ipv4/ip_forward
|
echo 1 > /proc/sys/net/ipv4/ip_forward)&
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user