Update OS check
- Add a check for Ubuntu 18.04 on architectures other than x86_64, which is not supported by the VPN scripts for Libreswan 4.9.
This commit is contained in:
parent
19d4ea067f
commit
4f8a19d337
@ -41,6 +41,7 @@ check_vz() {
|
|||||||
|
|
||||||
check_os() {
|
check_os() {
|
||||||
os_type=$(lsb_release -si 2>/dev/null)
|
os_type=$(lsb_release -si 2>/dev/null)
|
||||||
|
os_arch=$(uname -m | tr -dc 'A-Za-z0-9_-')
|
||||||
[ -z "$os_type" ] && [ -f /etc/os-release ] && os_type=$(. /etc/os-release && printf '%s' "$ID")
|
[ -z "$os_type" ] && [ -f /etc/os-release ] && os_type=$(. /etc/os-release && printf '%s' "$ID")
|
||||||
case $os_type in
|
case $os_type in
|
||||||
[Uu]buntu)
|
[Uu]buntu)
|
||||||
@ -60,6 +61,14 @@ check_os() {
|
|||||||
if [ "$os_ver" = 8 ] || [ "$os_ver" = "jessiesid" ]; then
|
if [ "$os_ver" = 8 ] || [ "$os_ver" = "jessiesid" ]; then
|
||||||
exiterr "Debian 8 or Ubuntu < 16.04 is not supported."
|
exiterr "Debian 8 or Ubuntu < 16.04 is not supported."
|
||||||
fi
|
fi
|
||||||
|
if [ "$os_type" = "ubuntu" ] && [ "$os_ver" = "bustersid" ] \
|
||||||
|
&& [ "$os_arch" != "x86_64" ]; then
|
||||||
|
cat 1>&2 <<EOF
|
||||||
|
Error: For Ubuntu 18.04, this script supports only the x86_64 architecture.
|
||||||
|
This system runs on $os_arch and is unsupported.
|
||||||
|
EOF
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
check_libreswan() {
|
check_libreswan() {
|
||||||
@ -172,7 +181,6 @@ install_pkgs() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
install_nss_pkgs() {
|
install_nss_pkgs() {
|
||||||
os_arch=$(uname -m | tr -dc 'A-Za-z0-9_-')
|
|
||||||
if [ "$os_type" = "ubuntu" ] && [ "$os_ver" = "bustersid" ] && [ "$os_arch" = "x86_64" ] \
|
if [ "$os_type" = "ubuntu" ] && [ "$os_ver" = "bustersid" ] && [ "$os_arch" = "x86_64" ] \
|
||||||
&& ! dpkg -l libnss3-dev 2>/dev/null | grep -qF '3.49.1'; then
|
&& ! dpkg -l libnss3-dev 2>/dev/null | grep -qF '3.49.1'; then
|
||||||
base_url="https://github.com/hwdsl2/vpn-extras/releases/download/v1.0.0"
|
base_url="https://github.com/hwdsl2/vpn-extras/releases/download/v1.0.0"
|
||||||
|
@ -74,6 +74,7 @@ EOF
|
|||||||
|
|
||||||
check_os() {
|
check_os() {
|
||||||
os_type=$(lsb_release -si 2>/dev/null)
|
os_type=$(lsb_release -si 2>/dev/null)
|
||||||
|
os_arch=$(uname -m | tr -dc 'A-Za-z0-9_-')
|
||||||
[ -z "$os_type" ] && [ -f /etc/os-release ] && os_type=$(. /etc/os-release && printf '%s' "$ID")
|
[ -z "$os_type" ] && [ -f /etc/os-release ] && os_type=$(. /etc/os-release && printf '%s' "$ID")
|
||||||
case $os_type in
|
case $os_type in
|
||||||
[Uu]buntu)
|
[Uu]buntu)
|
||||||
@ -93,6 +94,14 @@ check_os() {
|
|||||||
if [ "$os_ver" = 8 ] || [ "$os_ver" = "jessiesid" ]; then
|
if [ "$os_ver" = 8 ] || [ "$os_ver" = "jessiesid" ]; then
|
||||||
exiterr "Debian 8 or Ubuntu < 16.04 is not supported."
|
exiterr "Debian 8 or Ubuntu < 16.04 is not supported."
|
||||||
fi
|
fi
|
||||||
|
if [ "$os_type" = "ubuntu" ] && [ "$os_ver" = "bustersid" ] \
|
||||||
|
&& [ "$os_arch" != "x86_64" ]; then
|
||||||
|
cat 1>&2 <<EOF
|
||||||
|
Error: For Ubuntu 18.04, this script supports only the x86_64 architecture.
|
||||||
|
This system runs on $os_arch and is unsupported.
|
||||||
|
EOF
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
check_iface() {
|
check_iface() {
|
||||||
@ -261,7 +270,6 @@ install_vpn_pkgs() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
install_nss_pkgs() {
|
install_nss_pkgs() {
|
||||||
os_arch=$(uname -m | tr -dc 'A-Za-z0-9_-')
|
|
||||||
if [ "$os_type" = "ubuntu" ] && [ "$os_ver" = "bustersid" ] && [ "$os_arch" = "x86_64" ] \
|
if [ "$os_type" = "ubuntu" ] && [ "$os_ver" = "bustersid" ] && [ "$os_arch" = "x86_64" ] \
|
||||||
&& ! dpkg -l libnss3-dev 2>/dev/null | grep -qF '3.49.1'; then
|
&& ! dpkg -l libnss3-dev 2>/dev/null | grep -qF '3.49.1'; then
|
||||||
base_url="https://github.com/hwdsl2/vpn-extras/releases/download/v1.0.0"
|
base_url="https://github.com/hwdsl2/vpn-extras/releases/download/v1.0.0"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user