udpate
This commit is contained in:
+3
-6
@@ -102,16 +102,13 @@ check_config_file(){
|
|||||||
|
|
||||||
# 使用singbox容器校验配置文件语义合法性
|
# 使用singbox容器校验配置文件语义合法性
|
||||||
echo "正在使用 sing-box 校验配置文件..."
|
echo "正在使用 sing-box 校验配置文件..."
|
||||||
local compose_file="$script_dir/../docker-compose.yml"
|
if ! docker compose -f "$compose_file" run --rm \
|
||||||
local singbox_image=$(grep 'image:' "$compose_file" | grep 'sing-box' | awk '{print $2}' | tr -d '"')
|
sing-box \
|
||||||
if ! docker run --rm \
|
|
||||||
-v "$(realpath "$config_file"):/etc/sing-box/config.json:ro" \
|
|
||||||
"$singbox_image" \
|
|
||||||
check -c "/etc/sing-box/config.json"; then
|
check -c "/etc/sing-box/config.json"; then
|
||||||
echo "sing-box 配置文件校验失败, 请检查配置内容."
|
echo "sing-box 配置文件校验失败, 请检查配置内容."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# 重启docker容器
|
# 重启docker容器
|
||||||
|
|||||||
Reference in New Issue
Block a user