mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-27 01:32:08 +03:00
Updated Installation (markdown)
+34
-3
@@ -173,7 +173,7 @@ case "${ARCH}" in
|
||||
armv7* | armv7) XUI_ARCH="armv7" ;;
|
||||
armv6* | armv6) XUI_ARCH="armv6" ;;
|
||||
armv5* | armv5) XUI_ARCH="armv5" ;;
|
||||
s390x) echo 's390x' ;;
|
||||
s390x) XUI_ARCH="s390x" ;;
|
||||
*) XUI_ARCH="amd64" ;;
|
||||
esac
|
||||
|
||||
@@ -191,16 +191,47 @@ case "${ARCH}" in
|
||||
armv7* | armv7) XUI_ARCH="armv7" ;;
|
||||
armv6* | armv6) XUI_ARCH="armv6" ;;
|
||||
armv5* | armv5) XUI_ARCH="armv5" ;;
|
||||
s390x) echo 's390x' ;;
|
||||
s390x) XUI_ARCH="s390x" ;;
|
||||
*) XUI_ARCH="amd64" ;;
|
||||
esac
|
||||
|
||||
# Detect OS release
|
||||
if [[ -f /etc/os-release ]]; then
|
||||
source /etc/os-release
|
||||
release=$ID
|
||||
elif [[ -f /usr/lib/os-release ]]; then
|
||||
source /usr/lib/os-release
|
||||
release=$ID
|
||||
else
|
||||
echo "Failed to detect OS"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd /root/
|
||||
rm -rf x-ui/ /usr/local/x-ui/ /usr/bin/x-ui
|
||||
tar zxvf x-ui-linux-${XUI_ARCH}.tar.gz
|
||||
chmod +x x-ui/x-ui x-ui/bin/xray-linux-* x-ui/x-ui.sh
|
||||
cp x-ui/x-ui.sh /usr/bin/x-ui
|
||||
cp -f x-ui/x-ui.service /etc/systemd/system/
|
||||
|
||||
# Copy appropriate service file based on OS
|
||||
if [ -f "x-ui/x-ui.service" ]; then
|
||||
cp -f x-ui/x-ui.service /etc/systemd/system/
|
||||
elif [[ "$release" == "ubuntu" || "$release" == "debian" || "$release" == "armbian" ]]; then
|
||||
if [ -f "x-ui/x-ui.service.debian" ]; then
|
||||
cp -f x-ui/x-ui.service.debian /etc/systemd/system/x-ui.service
|
||||
else
|
||||
echo "Service file not found in archive, downloading..."
|
||||
curl -fLo /etc/systemd/system/x-ui.service https://raw.githubusercontent.com/MHSanaei/3x-ui/main/x-ui.service.debian
|
||||
fi
|
||||
else
|
||||
if [ -f "x-ui/x-ui.service.rhel" ]; then
|
||||
cp -f x-ui/x-ui.service.rhel /etc/systemd/system/x-ui.service
|
||||
else
|
||||
echo "Service file not found in archive, downloading..."
|
||||
curl -fLo /etc/systemd/system/x-ui.service https://raw.githubusercontent.com/MHSanaei/3x-ui/main/x-ui.service.rhel
|
||||
fi
|
||||
fi
|
||||
|
||||
mv x-ui/ /usr/local/
|
||||
systemctl daemon-reload
|
||||
systemctl enable x-ui
|
||||
|
||||
Reference in New Issue
Block a user