From e5835c299c2c975354e1e9ab7b6fa1497183d963 Mon Sep 17 00:00:00 2001 From: Pavel Kogen Date: Tue, 24 Sep 2024 12:53:12 +0300 Subject: [PATCH] OS Support - Amazon Linux (#2564) --- README.es_ES.md | 1 + README.md | 1 + README.ru_RU.md | 1 + README.zh_CN.md | 1 + install.sh | 10 +++++++--- x-ui.sh | 10 +++++++--- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/README.es_ES.md b/README.es_ES.md index bab3a57a..5c0b8109 100644 --- a/README.es_ES.md +++ b/README.es_ES.md @@ -225,6 +225,7 @@ location /sub { - AlmaLinux 9+ - Rockylinux 9+ - OpenSUSE Tubleweed +- Amazon Linux 2023 ## Arquitecturas y Dispositivos Compatibles diff --git a/README.md b/README.md index d2d2cf17..0b5a5a99 100644 --- a/README.md +++ b/README.md @@ -254,6 +254,7 @@ location /sub { - Rocky Linux 9+ - Oracle Linux 8+ - OpenSUSE Tubleweed +- Amazon Linux 2023 ## Supported Architectures and Devices diff --git a/README.ru_RU.md b/README.ru_RU.md index a1541712..07e30a5b 100644 --- a/README.ru_RU.md +++ b/README.ru_RU.md @@ -253,6 +253,7 @@ location /sub { - Rocky Linux 9+ - Oracle Linux 8+ - OpenSUSE Tubleweed +- Amazon Linux 2023 ## Поддерживаемые архитектуры и устройства diff --git a/README.zh_CN.md b/README.zh_CN.md index eab52883..0406b1b9 100644 --- a/README.zh_CN.md +++ b/README.zh_CN.md @@ -248,6 +248,7 @@ location /sub { - AlmaLinux 9+ - Rockylinux 9+ - OpenSUSE Tubleweed +- Amazon Linux 2023 ## 支持的架构和设备
diff --git a/install.sh b/install.sh index d60d9a8b..2fe66b08 100644 --- a/install.sh +++ b/install.sh @@ -39,12 +39,12 @@ arch() { echo "arch: $(arch)" os_version="" -os_version=$(grep -i version_id /etc/os-release | cut -d \" -f2 | cut -d . -f1) +os_version=$(grep "^VERSION_ID" /etc/os-release | cut -d '=' -f2 | tr -d '"') if [[ "${release}" == "arch" ]]; then echo "Your OS is Arch Linux" elif [[ "${release}" == "parch" ]]; then - echo "Your OS is Parch linux" + echo "Your OS is Parch Linux" elif [[ "${release}" == "manjaro" ]]; then echo "Your OS is Manjaro" elif [[ "${release}" == "armbian" ]]; then @@ -63,6 +63,10 @@ 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 11 ]]; then echo -e "${red} Please use Debian 11 or higher ${plain}\n" && exit 1 @@ -94,8 +98,8 @@ else echo "- Rocky Linux 9+" echo "- Oracle Linux 8+" echo "- OpenSUSE Tumbleweed" + echo "- Amazon Linux 2023" exit 1 - fi install_base() { diff --git a/x-ui.sh b/x-ui.sh index 0b6bd331..46449217 100644 --- a/x-ui.sh +++ b/x-ui.sh @@ -36,12 +36,12 @@ fi echo "The OS release is: $release" os_version="" -os_version=$(grep -i version_id /etc/os-release | cut -d \" -f2 | cut -d . -f1) +os_version=$(grep "^VERSION_ID" /etc/os-release | cut -d '=' -f2 | tr -d '"') if [[ "${release}" == "arch" ]]; then echo "Your OS is Arch Linux" elif [[ "${release}" == "parch" ]]; then - echo "Your OS is Parch linux" + echo "Your OS is Parch Linux" elif [[ "${release}" == "manjaro" ]]; then echo "Your OS is Manjaro" elif [[ "${release}" == "armbian" ]]; then @@ -60,6 +60,10 @@ 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 11 ]]; then echo -e "${red} Please use Debian 11 or higher ${plain}\n" && exit 1 @@ -91,8 +95,8 @@ else echo "- Rocky Linux 9+" echo "- Oracle Linux 8+" echo "- OpenSUSE Tumbleweed" + echo "- Amazon Linux 2023" exit 1 - fi # Declare Variables