chore: setup napcat at entrypoint (close #17)

This commit is contained in:
WWWw 2024-05-13 11:19:02 +08:00 committed by GitHub
parent 3225de34e8
commit 14f03a7454
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,6 +15,12 @@ chech_quotes(){
CONFIG_PATH=napcat/config/onebot11_$ACCOUNT.json CONFIG_PATH=napcat/config/onebot11_$ACCOUNT.json
# 容器首次启动时执行 # 容器首次启动时执行
if [ ! -f "$CONFIG_PATH" ]; then if [ ! -f "$CONFIG_PATH" ]; then
# 安装 napcat
rarch=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/x64/)
unzip NapCat.linux.${rarch}.zip -d .
mv NapCat.linux.${rarch} napcat
chmod +x napcat/napcat.sh
if [ "$WEBUI_TOKEN" ]; then if [ "$WEBUI_TOKEN" ]; then
echo "{\"port\": 6099,\"token\": \"$WEBUI_TOKEN\",\"loginRate\": 3}" > napcat/config/webui.json echo "{\"port\": 6099,\"token\": \"$WEBUI_TOKEN\",\"loginRate\": 3}" > napcat/config/webui.json
fi fi