forked from Lynn-Becky/Alpine-x-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
alpine-xui.sh
41 lines (31 loc) · 1.21 KB
/
alpine-xui.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[0;33m'
plain='\033[0m'
echo -e "${green}Alpine-x-ui 安装脚本v0.4 "
echo -e "${green}项目地址:https://github.com/Lynn-Becky/Alpine-x-ui"
read -p "回车键继续..."
echo -e "x-ui install for alpine"
# check root
[[ $EUID -ne 0 ]] && echo -e "${red}错误:${plain} 必须使用root用户运行此脚本!\n" && exit 1
# check os
if cat /etc/issue | grep -Eqi "alpine"; then
release="alpine"
else
echo -e "${red}未检测到系统版本,请联系脚本作者!${plain}\n" && exit 1
fi
echo "检查安装环境"
apk add bash && apk add curl && apk add wget
mkdir /lib64
cp /lib/ld-musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
# install x-ui
bash <(curl -Ls https://raw.githubusercontent.com/Lynn-Becky/Alpine-x-ui/main/install.sh)
# repair datebase
curl -Ls https://raw.githubusercontent.com/Lynn-Becky/Alpine-x-ui/main/Dependency/x-ui.db -o x-ui.db
mv x-ui.db /etc/x-ui/
chown 501.dialout /etc/x-ui/x-ui.db
echo -e "${plain}x-ui安装完成"
echo -e "${green}正在启动x-ui...."
/etc/init.d/x-ui restart
echo -e "${green}默认用户名与密码均为admin,端口为9000。请立即修改,需要修改请使用x-ui命令或web界面!${plain}\n"