Skip to content

Commit b03024d

Browse files
authored
Merge pull request #295 from AmiyaBot/V6-dev
V6 dev
2 parents 262a3a7 + 55e1106 commit b03024d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

entrypoint.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,23 @@
22

33
BOT_FOLDER=/amiyabot
44

5+
# step 0: 备份config文件夹
6+
if [ -d "$BOT_FOLDER/config/" ]; then
7+
cp -r $BOT_FOLDER/config $BOT_FOLDER/config.bak
8+
fi
9+
510
# step 1: 解压/覆盖bot文件
611
if [ -f "amiyabot.tar.gz" ]; then
712
tar -zxvf amiyabot.tar.gz -C $BOT_FOLDER
13+
rm amiyabot.tar.gz
814
fi
915

1016
# step 2: 判断是否首次运行
1117
if [ ! -f "$BOT_FOLDER/first_run" ]; then
1218
cd $BOT_FOLDER
1319
python entrypoint.py
14-
touch first_run
20+
else
21+
cp -r $BOT_FOLDER/config.bak $BOT_FOLDER/config
1522
fi
1623

1724
# step 3: 启动bot

0 commit comments

Comments
 (0)