modified: README.md

modified:   install.sh
This commit is contained in:
Hai HUANG 2024-02-29 18:15:23 +08:00
parent d6cd0611d4
commit b3b24163c4
2 changed files with 19 additions and 6 deletions

View file

@ -21,7 +21,7 @@
## Install & Upgrade ## 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 ## Install Custom Version

View file

@ -74,7 +74,8 @@ elif [[ "${release}" == "manjaro" ]]; then
echo "Your OS is Manjaro" echo "Your OS is Manjaro"
elif [[ "${release}" == "armbian" ]]; then elif [[ "${release}" == "armbian" ]]; then
echo "Your OS is Armbian" echo "Your OS is Armbian"
elif [[ "${release}" == "alpine" ]]; then
echo "Your OS is Alpine"
else else
echo -e "${red}Failed to check the OS version, please contact the author!${plain}" && exit 1 echo -e "${red}Failed to check the OS version, please contact the author!${plain}" && exit 1
fi fi
@ -90,6 +91,9 @@ install_base() {
arch | manjaro) arch | manjaro)
pacman -Syu && pacman -Syu --noconfirm wget curl tar tzdata 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 apt-get update && apt install -y -q wget curl tar tzdata
;; ;;
@ -158,7 +162,11 @@ install_x-ui() {
fi fi
if [[ -e /usr/local/x-ui/ ]]; then 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 rm /usr/local/x-ui/ -rf
fi fi
@ -180,9 +188,14 @@ install_x-ui() {
chmod +x /usr/bin/x-ui chmod +x /usr/bin/x-ui
config_after_install config_after_install
systemctl daemon-reload if release="alpine"; then
systemctl enable x-ui rc-update add x-ui boot
systemctl start x-ui 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 "${green}x-ui ${last_version}${plain} installation finished, it is running now..."
echo -e "" echo -e ""
echo -e "x-ui control menu usages: " echo -e "x-ui control menu usages: "