更新bot.sh

This commit is contained in:
whyour 2021-05-10 00:19:43 +08:00
parent 71c670ce0c
commit 0d8168c588

View File

@ -3,21 +3,28 @@
## 导入通用变量与函数 ## 导入通用变量与函数
dir_shell=/ql/shell dir_shell=/ql/shell
. $dir_shell/share.sh . $dir_shell/share.sh
repo_path="${dir_repo}/SuMaiKaDe_jddockerbot"
echo -e "1、安装bot依赖...\n" echo -e "1、安装bot依赖...\n"
apk --no-cache add -f zlib-dev gcc jpeg-dev python3-dev musl-dev freetype-dev apk --no-cache add -f zlib-dev gcc jpeg-dev python3-dev musl-dev freetype-dev
pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple echo
pip3 install telethon python-socks[asyncio] pillow qrcode requests prettytable
echo -e "2、下载bot所需文件...\n" echo -e "2、下载bot所需文件...\n"
repo_path="${dir_repo}/SuMaiKaDe_jddockerbot"
git clone -b master https://ghproxy.com/https://github.com/SuMaiKaDe/jddockerbot.git $repo_path git clone -b master https://ghproxy.com/https://github.com/SuMaiKaDe/jddockerbot.git $repo_path
cp -rf "$repo_path/jbot" $dir_root cp -rf "$repo_path/jbot" $dir_root
cp -f "$repo_path/config/bot.json" "$dir_root/config" cp -f "$repo_path/config/bot.json" "$dir_root/config"
echo
echo -e "3、启动bot程序...\n" echo -e "3、安装python3依赖...\n"
pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
cp -f "$repo_path/jbot/requirements.txt" "$dir_root"
pip3 install -r requirements.txt
echo
echo -e "4、启动bot程序...\n"
cd $dir_root cd $dir_root
ps -ef | grep "python3 -m jbot" | grep -v grep | awk '{print $1}' | xargs kill -9 2>/dev/null ps -ef | grep "python3 -m jbot" | grep -v grep | awk '{print $1}' | xargs kill -9 2>/dev/null
nohup python3 -m jbot & nohup python3 -m jbot &
echo
exit 0 exit 0