1
0
mirror of synced 2024-11-26 06:46:06 +03:00

Improve RPi fix

- Minor improvement to Raspberry Pi fix
This commit is contained in:
hwdsl2 2017-09-23 14:19:30 -05:00
parent dc71db3451
commit 98a3f29407

View File

@ -267,6 +267,12 @@ conn xauth-psk
also=shared also=shared
EOF EOF
# Workaround for Raspbian 9
if grep -qs 'Raspbian GNU/Linux 9' /etc/os-release; 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
fi
# Specify IPsec PSK # Specify IPsec PSK
conf_bk "/etc/ipsec.secrets" conf_bk "/etc/ipsec.secrets"
cat > /etc/ipsec.secrets <<EOF cat > /etc/ipsec.secrets <<EOF
@ -449,15 +455,6 @@ service fail2ban restart 2>/dev/null
service ipsec restart 2>/dev/null service ipsec restart 2>/dev/null
service xl2tpd 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 cat <<EOF
================================================ ================================================