forked from jinnan11/serv00-alist
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_openlist.sh
More file actions
73 lines (60 loc) · 2.23 KB
/
Copy pathinstall_openlist.sh
File metadata and controls
73 lines (60 loc) · 2.23 KB
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
66
67
68
69
70
71
72
73
# 作者: 槿南11
# 主页:https://jinnan.top
# GitHub:https://github.com/jinnan11/serv00-alist
# 版权所有,请勿删除
# 清屏
clear
# 判断是否在 public_nodejs 目录下
if [ "$(basename "$(pwd)")" == "public_nodejs" ]; then
# 删除残留文件,如果不存在则跳过
[ -f public/index.html ] && rm public/index.html
[ -f start.sh ] && rm start.sh
[ -f alist ] && rm alist
# 判断是否有所需文件
files=("app.js" "start.sh" "package.json" "web.js")
urls=(
"https://raw.githubusercontent.com/misakano7545/serv00-openlist/main/alist/app.js"
"https://raw.githubusercontent.com/misakano7545/serv00-openlist/main/alist/start.sh"
"https://raw.githubusercontent.com/misakano7545/serv00-openlist/main/alist/package.json"
"https://github.com/OpenListTeam/OpenList/releases/latest/download/openlist-freebsd-amd64.tar.gz"
)
for i in "${!files[@]}"; do
if [ ! -f "${files[$i]}" ]; then
wget "${urls[$i]}"
fi
done
# 判断是否存在 alist 文件
if [ -f "openlist-freebsd-amd64.tar.gz" ]; then
# 如果存在,执行以下操作
tar -xzf openlist-freebsd-amd64.tar.gz
rm openlist-freebsd-amd64.tar.gz
rm -rf temp
mv alist web.js
chmod +x web.js
./web.js server
fi
# 判断是否存在 data 文件夹
if [ -d "data" ]; then
# 清屏
clear
# 如果存在,显示安装完成信息
echo -e "已成功安装 Alist!\n"
echo -e "请在 File manager 中,编辑 app.js 和 data/config.json\n"
echo -e "作者:https://jinnan.top\nQQ群:244184124 欢迎加入交流~\n"
else
# 使您能够运行自己的软件
devil binexec on
# 删除残留文件,如果不存在则跳过
[ -f web.js ] && rm web.js
[ -f start.sh ] && rm start.sh
# 清屏
clear
# 如果不存在,提示信息
echo "检测到不存在 data 文件夹,请断开重连SSH,再次输入这条指令。"
fi
else
# 清屏
clear
# 显示错误信息
echo "检测到未在public_nodejs目录下,请确认网站添加的类型是否为nodejs。"
fi