forked from yixiu001/serv00-script
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vless.sh
66 lines (56 loc) · 2.63 KB
/
vless.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
# Function to check if pm2 is installed
check_pm2_installed() {
if command -v pm2 &>/dev/null; then
return 0 # pm2已安装
else
return 1 # pm2未安装
fi
}
# Function to install pm2
install_pm2() {
if ! check_pm2_installed; then
curl -s https://raw.githubusercontent.com/k0baya/alist_repl/main/serv00/install-pm2.sh | bash
echo "pm2安装成功。"
else
echo "pm2已经安装。"
fi
}
# Function to deploy vless
deploy_vless() {
# 赋予vless维护脚本权限
chmod +x ./vless/check_vless.sh
# 安装依赖
npm install --prefix ./vless
# 进入工作目录
cp -r ./vless ~/domains/$USER.serv00.net
# ANSI颜色码
GREEN='\033[0;32m'
NC='\033[0m' # 恢复默认颜色
# 输出绿色的 "YI XIU"
echo -e "${GREEN} .----------------. .----------------. .----------------. .----------------. .----------------. "
echo -e "| .--------------. || .--------------. || .--------------. || .--------------. || .--------------. |"
echo -e "| | ____ ____ | || | _____ | || | ____ ____ | || | _____ | || | _____ _____ | |"
echo -e "| | |_ _||_ _| | || | |_ _| | || | |_ _||_ _| | || | |_ _| | || ||_ _||_ _|| |"
echo -e "| | \\ \\ / / | || | | | | || | \\ \\ / / | || | | | | || | | | | | | |"
echo -e "| | \\ \\/ / | || | | | | || | > \`' < | || | | | | || | | ' ' | | |"
echo -e "| | _| |_ | || | _| |_ | || | _/ /'\\ \\_ | || | _| |_ | || | \\ \`--' / | |"
echo -e "| | |______| | || | |_____| | || | |____||____| | || | |_____| | || | \`.__.' | |"
echo -e "| | | || | | || | | || | | || | | |"
echo -e "| '--------------' || '--------------' || '--------------' || '--------------' || '--------------' |"
echo -e " '----------------' '----------------' '----------------' '----------------' '----------------' ${NC}"
echo -e "--------------------------------------------------------------------------------------------------"
echo -e "一休YouTuBe: ${GREEN}https://www.youtube.com/@yixiu001${NC}"
echo -e "TG技术交流群: ${GREEN}https://t.me/yxjsjl${NC}"
echo -e "--------------------------------------------------------------------------------------------------"
echo -e "请执行以下脚本:${GREEN}cd ~/domains/$USER.serv00.net/vless && ./check_vless.sh -p <端口号>${NC}"
}
# Main function
main() {
echo "正在安装pm2..."
install_pm2
echo "正在部署vless到指定目录..."
deploy_vless
}
# 执行主函数
main "$@"