Optimize sing-box reloads and config generation

This commit is contained in:
ushan0v
2026-07-14 04:12:17 +03:00
parent 264d6699fe
commit 8094108286
21 changed files with 56 additions and 755 deletions
+5 -1
View File
@@ -123,7 +123,11 @@ tmp_file_line="$(grep -n '^function make_tmp_file' "$ACTION_UC" | cut -d: -f1)"
[ -n "$init_line" ] && [ -n "$tmp_file_line" ] && [ "$init_line" -lt "$tmp_file_line" ] ||
fail "components/action.uc must declare init_tmp_dir before make_tmp_file for OpenWrt ucode"
sed -n '26,64p' "$ACTION_UC" >"$WORK_DIR/action-command-success.uc"
awk '
/^function as_string\(value\)/ { capture = 1 }
/^function command_output\(command\)/ { capture = 0 }
capture { print }
' "$ACTION_UC" >"$WORK_DIR/action-command-success.uc"
cat >>"$WORK_DIR/action-command-success.uc" <<'UCODE'
let output_path = ARGV[0] || "";
if (output_path == "" ||