Improve xl2tpd workaround
- Exclude Ubuntu from xl2tpd 1.3.12 workaround (Ref: 3f8e79b
), because
updated xl2tpd packages are now available for Ubuntu 16.04 and 18.04
See: https://bugs.launchpad.net/ubuntu/+source/xl2tpd/+bug/1760796
- Add Linux kernel 4.16 to the list of kernels to work around
- Cleanup
This commit is contained in:
parent
89e105fcda
commit
1227a0ed5d
28
vpnsetup.sh
28
vpnsetup.sh
@ -173,20 +173,22 @@ apt-get -yq install libnss3-dev libnspr4-dev pkg-config \
|
|||||||
libevent-dev ppp xl2tpd || exiterr2
|
libevent-dev ppp xl2tpd || exiterr2
|
||||||
|
|
||||||
case "$(uname -r)" in
|
case "$(uname -r)" in
|
||||||
4.14*|4.15*)
|
4.1[456]*)
|
||||||
L2TP_VER=1.3.12
|
if ! printf '%s' "$os_type" | head -n 1 | grep -qiF ubuntu; then
|
||||||
l2tp_file="xl2tpd-$L2TP_VER.tar.gz"
|
L2TP_VER=1.3.12
|
||||||
l2tp_url1="https://github.com/xelerance/xl2tpd/archive/v$L2TP_VER.tar.gz"
|
l2tp_dir="xl2tpd-$L2TP_VER"
|
||||||
l2tp_url2="https://mirrors.kernel.org/ubuntu/pool/universe/x/xl2tpd/xl2tpd_$L2TP_VER.orig.tar.gz"
|
l2tp_file="$l2tp_dir.tar.gz"
|
||||||
apt-get -yq install libpcap0.8-dev || exiterr2
|
l2tp_url="https://github.com/xelerance/xl2tpd/archive/v$L2TP_VER.tar.gz"
|
||||||
if ! { wget -t 3 -T 30 -nv -O "$l2tp_file" "$l2tp_url1" || wget -t 3 -T 30 -nv -O "$l2tp_file" "$l2tp_url2"; }; then
|
apt-get -yq install libpcap0.8-dev || exiterr2
|
||||||
exit 1
|
if ! wget -t 3 -T 30 -nv -O "$l2tp_file" "$l2tp_url"; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
/bin/rm -rf "/opt/src/$l2tp_dir"
|
||||||
|
tar xzf "$l2tp_file" && /bin/rm -f "$l2tp_file"
|
||||||
|
cd "$l2tp_dir" && make -s 2>/dev/null && PREFIX=/usr make -s install
|
||||||
|
cd /opt/src || exit 1
|
||||||
|
/bin/rm -rf "/opt/src/$l2tp_dir"
|
||||||
fi
|
fi
|
||||||
/bin/rm -rf "/opt/src/xl2tpd-$L2TP_VER"
|
|
||||||
tar xzf "$l2tp_file" && /bin/rm -f "$l2tp_file"
|
|
||||||
cd "xl2tpd-$L2TP_VER" && make -s 2>/dev/null && PREFIX=/usr make -s install
|
|
||||||
cd /opt/src || exit 1
|
|
||||||
/bin/rm -rf "/opt/src/xl2tpd-$L2TP_VER"
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
@ -163,21 +163,21 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
case "$(uname -r)" in
|
case "$(uname -r)" in
|
||||||
4.14*|4.15*)
|
4.1[456]*)
|
||||||
if grep -qs "release 6" /etc/redhat-release; then
|
if grep -qs "release 6" /etc/redhat-release; then
|
||||||
L2TP_VER=1.3.12
|
L2TP_VER=1.3.12
|
||||||
l2tp_file="xl2tpd-$L2TP_VER.tar.gz"
|
l2tp_dir="xl2tpd-$L2TP_VER"
|
||||||
l2tp_url1="https://github.com/xelerance/xl2tpd/archive/v$L2TP_VER.tar.gz"
|
l2tp_file="$l2tp_dir.tar.gz"
|
||||||
l2tp_url2="https://mirrors.kernel.org/ubuntu/pool/universe/x/xl2tpd/xl2tpd_$L2TP_VER.orig.tar.gz"
|
l2tp_url="https://github.com/xelerance/xl2tpd/archive/v$L2TP_VER.tar.gz"
|
||||||
yum "$REPO2" "$REPO3" -y install libpcap-devel || exiterr2
|
yum "$REPO2" "$REPO3" -y install libpcap-devel || exiterr2
|
||||||
if ! { wget -t 3 -T 30 -nv -O "$l2tp_file" "$l2tp_url1" || wget -t 3 -T 30 -nv -O "$l2tp_file" "$l2tp_url2"; }; then
|
if ! wget -t 3 -T 30 -nv -O "$l2tp_file" "$l2tp_url"; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
/bin/rm -rf "/opt/src/xl2tpd-$L2TP_VER"
|
/bin/rm -rf "/opt/src/$l2tp_dir"
|
||||||
tar xzf "$l2tp_file" && /bin/rm -f "$l2tp_file"
|
tar xzf "$l2tp_file" && /bin/rm -f "$l2tp_file"
|
||||||
cd "xl2tpd-$L2TP_VER" && make -s 2>/dev/null && PREFIX=/usr make -s install
|
cd "$l2tp_dir" && make -s 2>/dev/null && PREFIX=/usr make -s install
|
||||||
cd /opt/src || exit 1
|
cd /opt/src || exit 1
|
||||||
/bin/rm -rf "/opt/src/xl2tpd-$L2TP_VER"
|
/bin/rm -rf "/opt/src/$l2tp_dir"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
Loading…
Reference in New Issue
Block a user