Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'x-ui.sh')
-rw-r--r--x-ui.sh87
1 files changed, 13 insertions, 74 deletions
diff --git a/x-ui.sh b/x-ui.sh
index d615e04e..1ef39619 100644
--- a/x-ui.sh
+++ b/x-ui.sh
@@ -33,85 +33,24 @@ else
echo "Failed to check the system OS, please contact the author!" >&2
exit 1
fi
-
echo "The OS release is: $release"
+check_glibc_version() {
+ glibc_version=$(ldd --version | head -n1 | awk '{print $NF}')
+
+ required_version="2.32"
+ if [[ "$(printf '%s\n' "$required_version" "$glibc_version" | sort -V | head -n1)" != "$required_version" ]]; then
+ echo -e "${red}GLIBC version $glibc_version is too old! Required: 2.32 or higher${plain}"
+ echo "Please upgrade to a newer version of your operating system to get a higher GLIBC version."
+ exit 1
+ fi
+ echo "GLIBC version: $glibc_version (meets requirement of 2.32+)"
+}
+check_glibc_version
+
os_version=""
os_version=$(grep "^VERSION_ID" /etc/os-release | cut -d '=' -f2 | tr -d '"' | tr -d '.')
-if [[ "${release}" == "arch" ]]; then
- echo "Your OS is Arch Linux"
-elif [[ "${release}" == "parch" ]]; then
- echo "Your OS is Parch Linux"
-elif [[ "${release}" == "manjaro" ]]; then
- echo "Your OS is Manjaro"
-elif [[ "${release}" == "armbian" ]]; then
- echo "Your OS is Armbian"
-elif [[ "${release}" == "alpine" ]]; then
- echo "Your OS is Alpine Linux"
-elif [[ "${release}" == "opensuse-tumbleweed" ]]; then
- echo "Your OS is OpenSUSE Tumbleweed"
-elif [[ "${release}" == "openEuler" ]]; then
- if [[ ${os_version} -lt 2203 ]]; then
- echo -e "${red} Please use OpenEuler 22.03 or higher ${plain}\n" && exit 1
- fi
-elif [[ "${release}" == "centos" ]]; then
- if [[ ${os_version} -lt 8 ]]; then
- echo -e "${red} Please use CentOS 8 or higher ${plain}\n" && exit 1
- fi
-elif [[ "${release}" == "ubuntu" ]]; then
- if [[ ${os_version} -lt 2204 ]]; then
- echo -e "${red} Please use Ubuntu 22 or higher version!${plain}\n" && exit 1
- fi
-elif [[ "${release}" == "fedora" ]]; then
- if [[ ${os_version} -lt 36 ]]; then
- echo -e "${red} Please use Fedora 36 or higher version!${plain}\n" && exit 1
- fi
-elif [[ "${release}" == "amzn" ]]; then
- if [[ ${os_version} != "2023" ]]; then
- echo -e "${red} Please use Amazon Linux 2023!${plain}\n" && exit 1
- fi
-elif [[ "${release}" == "debian" ]]; then
- if [[ ${os_version} -lt 12 ]]; then
- echo -e "${red} Please use Debian 12 or higher ${plain}\n" && exit 1
- fi
-elif [[ "${release}" == "almalinux" ]]; then
- if [[ ${os_version} -lt 95 ]]; then
- echo -e "${red} Please use AlmaLinux 9.5 or higher ${plain}\n" && exit 1
- fi
-elif [[ "${release}" == "rocky" ]]; then
- if [[ ${os_version} -lt 95 ]]; then
- echo -e "${red} Please use Rocky Linux 9.5 or higher ${plain}\n" && exit 1
- fi
-elif [[ "${release}" == "ol" ]]; then
- if [[ ${os_version} -lt 8 ]]; then
- echo -e "${red} Please use Oracle Linux 8 or higher ${plain}\n" && exit 1
- fi
-elif [[ "${release}" == "virtuozzo" ]]; then
- if [[ ${os_version} -lt 8 ]]; then
- echo -e "${red} Please use Virtuozzo Linux 8 or higher ${plain}\n" && exit 1
- fi
-else
- echo -e "${red}Your operating system is not supported by this script.${plain}\n"
- echo "Please ensure you are using one of the following supported operating systems:"
- echo "- Ubuntu 22.04+"
- echo "- Debian 12+"
- echo "- CentOS 8+"
- echo "- OpenEuler 22.03+"
- echo "- Fedora 36+"
- echo "- Arch Linux"
- echo "- Parch Linux"
- echo "- Manjaro"
- echo "- Armbian"
- echo "- AlmaLinux 9.5+"
- echo "- Rocky Linux 9.5+"
- echo "- Oracle Linux 8+"
- echo "- OpenSUSE Tumbleweed"
- echo "- Amazon Linux 2023"
- echo "- Virtuozzo Linux 8+"
- exit 1
-fi
-
# Declare Variables
log_folder="${XUI_LOG_FOLDER:=/var/log}"
iplimit_log_path="${log_folder}/3xipl.log"