Skip to content

Commit 334be91

Browse files
committed
fix(service): 将 prepare_singbox 下的 format -w -c 改为 check -c
1 parent cce73c6 commit 334be91

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

box/scripts/box.service

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ prepare_singbox() {
213213
# 确保日志路径是绝对路径
214214
${yq} '.log.output = "'"${box_run}/${bin_name}.log"'"' -i --output-format=json "${sing_config}" 2>/dev/null || true
215215

216-
# 格式化 sing-box 配置
217-
if ${bin_path} format -w -c "${sing_config}" > "${box_run}/${bin_name}.log" 2>&1; then
216+
# 检查 sing-box 配置
217+
if ${bin_path} check -c "${sing_config}" > "${box_run}/${bin_name}.log" 2>&1; then
218218
# 根据 network_mode 设置 auto_route
219219
if [[ "${network_mode}" == @(mixed|tun) ]]; then
220220
# 检查配置中是否有 "type": "tun"

0 commit comments

Comments
 (0)