Update start.sh

This commit is contained in:
wnlen
2026-01-18 21:21:37 +08:00
parent 4c807be68e
commit 99a568905e

View File

@ -523,11 +523,14 @@ if [ "$SKIP_CONFIG_REBUILD" != "true" ]; then
OLD_CFG="${Conf_Dir}/config.yaml" OLD_CFG="${Conf_Dir}/config.yaml"
if [ -x "$BIN" ] && [ -f "$NEW_CFG" ]; then if [ -x "$BIN" ] && [ -f "$NEW_CFG" ]; then
TEST_ERR="$Temp_Dir/config.test.err" TEST_OUT="$Temp_Dir/config.test.out"
: > "$TEST_ERR" : > "$TEST_OUT"
if ! "$BIN" -t -f "$NEW_CFG" >/dev/null 2>"$TEST_ERR"; then "$BIN" -t -f "$NEW_CFG" >"$TEST_OUT" 2>&1
echo "[ERROR] Generated config invalid, reason (tail 120):" >&2 test_rc=$?
tail -n 120 "$TEST_ERR" >&2
if [ $test_rc -ne 0 ]; then
echo "[ERROR] Generated config invalid, rc=$test_rc, reason (tail 200):" >&2
tail -n 200 "$TEST_OUT" >&2
echo "[ERROR] Generated config invalid, fallback to last good config: $OLD_CFG" >&2 echo "[ERROR] Generated config invalid, fallback to last good config: $OLD_CFG" >&2
if [ -f "$OLD_CFG" ]; then if [ -f "$OLD_CFG" ]; then