Qilan2 commited on
Commit
b143c54
·
verified ·
1 Parent(s): 5b767cf

Create a.sh

Browse files
Files changed (1) hide show
  1. st-free/a.sh +55 -0
st-free/a.sh ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ echo '拉取 SillyTavern 仓库'
3
+ git clone https://github.com/SillyTavern/SillyTavern -b release
4
+ echo '拉取 SillyTavern 仓库 完毕'
5
+ cd SillyTavern
6
+ ls
7
+ echo '删除文件 data config.yaml index.html server-main.js 完毕'
8
+ rm -r data config.yaml public/index.html src/server-main.js
9
+
10
+ # 提示用户输入源路径
11
+ read -p "请输入旧酒馆的路径(结尾带/): " source_path
12
+
13
+ # 去除路径末尾的斜杠(如果有)
14
+ source_path=$(echo "$source_path" | sed 's:/*$::')
15
+
16
+ # 检查源路径是否存在
17
+ if [ ! -d "$source_path" ]; then
18
+ echo "错误:旧酒馆的路径不存在"
19
+ exit 1
20
+ fi
21
+
22
+ # 移动 data 目录
23
+ echo "$source_path/data"
24
+ if [ -d "$source_path/data" ]; then
25
+ mv "$source_path/data" .
26
+ echo "成功移动 data 目录"
27
+ else
28
+ echo "警告:未找到 data 目录"
29
+ fi
30
+
31
+ # 移动 config.yaml
32
+ echo "$source_path/config.yaml"
33
+ if [ -f "$source_path/config.yaml" ]; then
34
+ mv "$source_path/config.yaml" .
35
+ echo "成功移动 config.yaml"
36
+ else
37
+ echo "警告:未找到 config.yaml"
38
+ fi
39
+
40
+ # 移动 index.html
41
+ echo "$source_path/public/index.html"
42
+ if [ -f "$source_path/public/index.html" ]; then
43
+ mv "$source_path/public/index.html" public/
44
+ echo "成功移动 index.html"
45
+ else
46
+ echo "警告:未找到 index.html"
47
+ fi
48
+
49
+ # 执行 wget 下载
50
+ echo '开始下载额外文件'
51
+ wget -O src/server-main.js 'https://huggingface.co/datasets/Qilan2/st-server/raw/main/st-free/server-main.js'
52
+ wget -O src/config.default.js 'https://huggingface.co/datasets/Qilan2/st-server/raw/main/st-free/config.default.js'
53
+ wget -O src/endpoints/users-internal.js 'https://huggingface.co/datasets/Qilan2/st-server/raw/main/st-free/users-internal.js'
54
+ wget -O src/middleware/ip-whitelist.js 'https://huggingface.co/datasets/Qilan2/st-server/raw/main/st-free/ip-whitelist.js'
55
+ echo '下载完成'