From cf263559d66ee26e6db4f54d20963b9c3ebcc6a1 Mon Sep 17 00:00:00 2001 From: initialencounter <2911583893@qq.com> Date: Sun, 12 May 2024 18:43:50 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=B6=88=E9=99=A4=E7=A0=B4=E5=9D=8F?= =?UTF-8?q?=E6=80=A7=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entrypoint.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index 2505308..b5c82fc 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,5 +1,27 @@ #!/bin/bash +chech_quotes(){ + local input="$1" + + if [[ $input =~ ^\".*\"$ ]]; then + echo "$input" + else + input=\""$input"\" + echo "$input" + fi +} + +chech_square_brackets(){ + local input="$1" + + if [[ $input =~ ^\[.*\]$ ]]; then + echo "$input" + else + input=[$input] + echo "$input" + fi +} + CONFIG_PATH=napcat/config/onebot11_$ACCOUNT.json # 容器首次启动时执行 if [ ! -f "a$CONFIG_PATH" ]; then @@ -27,6 +49,8 @@ if [ ! -f "a$CONFIG_PATH" ]; then : ${HTTP_HEART_ENABLE:='false'} : ${MUSIC_SIGN_URL:=''} : ${HTTP_SECRET:=''} + HTTP_URLS=$(chech_square_brackets $(chech_quotes $HTTP_URLS) + WS_URLS=$(chech_square_brackets $(chech_quotes $WS_URLS) cat < $CONFIG_PATH { "httpHost": "$HTTP_HOST",