Skip to content

Commit

Permalink
Merge pull request #294 from wutongshufqw/V6-dev
Browse files Browse the repository at this point in the history
修复配置文件被重置问题
  • Loading branch information
vivien8261 authored Sep 27, 2024
2 parents ffade70 + 992b4bc commit 55e1106
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,23 @@

BOT_FOLDER=/amiyabot

# step 0: 备份config文件夹
if [ -d "$BOT_FOLDER/config/" ]; then
cp -r $BOT_FOLDER/config $BOT_FOLDER/config.bak
fi

# step 1: 解压/覆盖bot文件
if [ -f "amiyabot.tar.gz" ]; then
tar -zxvf amiyabot.tar.gz -C $BOT_FOLDER
rm amiyabot.tar.gz
fi

# step 2: 判断是否首次运行
if [ ! -f "$BOT_FOLDER/first_run" ]; then
cd $BOT_FOLDER
python entrypoint.py
touch first_run
else
cp -r $BOT_FOLDER/config.bak $BOT_FOLDER/config
fi

# step 3: 启动bot
Expand Down

0 comments on commit 55e1106

Please sign in to comment.