Add Alpine Linux support (#3534)

* Add Alpine linux support

* Fix for reading logs
This commit is contained in:
Evgeny Volferts
2025-09-22 19:56:43 +00:00
committed by GitHub
parent 1016f3b4f9
commit b3e96230c4
3 changed files with 223 additions and 66 deletions

View File

@@ -56,6 +56,9 @@ install_base() {
opensuse-tumbleweed)
zypper refresh && zypper -q install -y wget curl tar timezone
;;
alpine)
apk update && apk add wget curl tar tzdata
;;
*)
apt-get update && apt-get install -y -q wget curl tar tzdata
;;
@@ -177,7 +180,11 @@ install_x-ui() {
# Stop x-ui service and remove old resources
if [[ -e /usr/local/x-ui/ ]]; then
systemctl stop x-ui
if [[ $release == "alpine" ]]; then
rc-service x-ui stop
else
systemctl stop x-ui
fi
rm /usr/local/x-ui/ -rf
fi
@@ -201,10 +208,18 @@ install_x-ui() {
chmod +x /usr/bin/x-ui
config_after_install
cp -f x-ui.service /etc/systemd/system/
systemctl daemon-reload
systemctl enable x-ui
systemctl start x-ui
if [[ $release == "alpine" ]]; then
wget -O /etc/init.d/x-ui https://raw.githubusercontent.com/MHSanaei/3x-ui/main/x-ui.rc
chmod +x /etc/init.d/x-ui
rc-update add x-ui
rc-service x-ui start
else
cp -f x-ui.service /etc/systemd/system/
systemctl daemon-reload
systemctl enable x-ui
systemctl start x-ui
fi
echo -e "${green}x-ui ${tag_version}${plain} installation finished, it is running now..."
echo -e ""
echo -e "┌───────────────────────────────────────────────────────┐