From b3b24163c4f7834ecc932acfd1a47ae7ae80db80 Mon Sep 17 00:00:00 2001 From: Hai HUANG <101720804+maple367@users.noreply.github.com> Date: Thu, 29 Feb 2024 18:15:23 +0800 Subject: [PATCH] modified: README.md modified: install.sh --- README.md | 2 +- install.sh | 23 ++++++++++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 14d569db..90f23701 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ ## Install & Upgrade ``` -bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh) +bash <(curl -Ls https://raw.githubusercontent.com/maple367/3x-ui/main/install.sh) ``` ## Install Custom Version diff --git a/install.sh b/install.sh index a9b6711b..4f42db93 100644 --- a/install.sh +++ b/install.sh @@ -74,7 +74,8 @@ 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" else echo -e "${red}Failed to check the OS version, please contact the author!${plain}" && exit 1 fi @@ -90,6 +91,9 @@ install_base() { arch | manjaro) pacman -Syu && pacman -Syu --noconfirm wget curl tar tzdata ;; + alpine) + apk update && apk add wget curl tar tzdata + ;; *) apt-get update && apt install -y -q wget curl tar tzdata ;; @@ -158,7 +162,11 @@ install_x-ui() { fi if [[ -e /usr/local/x-ui/ ]]; then - systemctl stop x-ui + if release="alpine"; then + service x-ui stop + else + systemctl stop x-ui + fi rm /usr/local/x-ui/ -rf fi @@ -180,9 +188,14 @@ install_x-ui() { chmod +x /usr/bin/x-ui config_after_install - systemctl daemon-reload - systemctl enable x-ui - systemctl start x-ui + if release="alpine"; then + rc-update add x-ui boot + rc-service x-ui start + else + systemctl daemon-reload + systemctl enable x-ui + systemctl start x-ui + fi echo -e "${green}x-ui ${last_version}${plain} installation finished, it is running now..." echo -e "" echo -e "x-ui control menu usages: "