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

Fixes for Raspberry Pi

- Change "start" to "restart", so that the 15-second delay actually works
  (wait for network interfaces to initialize)
- Workaround for Raspbian 9 (requires left=$PRIVATE_IP in ipsec.conf)
This commit is contained in:
hwdsl2 2017-09-21 01:23:03 -05:00
parent 3f2b2cbc0b
commit dc71db3451

View File

@ -425,8 +425,8 @@ cat >> /etc/rc.local <<'EOF'
# Added by hwdsl2 VPN script
(sleep 15
service ipsec start
service xl2tpd start
service ipsec restart
service xl2tpd restart
echo 1 > /proc/sys/net/ipv4/ip_forward)&
exit 0
EOF
@ -449,6 +449,15 @@ service fail2ban restart 2>/dev/null
service ipsec restart 2>/dev/null
service xl2tpd restart 2>/dev/null
# Workaround for Raspbian 9
if grep -qs raspbian /etc/os-release; then
if [ "$(sed 's/\..*//' /etc/debian_version)" = "9" ]; then
PRIVATE_IP=$(ip -4 route get 1 | awk '{print $NF;exit}')
check_ip "$PRIVATE_IP" && sed -i "s/left=%defaultroute/left=$PRIVATE_IP/" /etc/ipsec.conf
service ipsec restart
fi
fi
cat <<EOF
================================================