mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
Saving the configuration drops the syslog server address whenever the log of executed commands also contains "syslog on", which it almost always does, since you have to enable the thing after pointing it somewhere. parseConf() deduplicates by taking the matched text of a conf_overwrite entry and removing every stored line that starts with it. For "syslog on" the entry that matches is the catch-all ^syslog\b, so the matched text is just "syslog" and the filter removes anything beginning with "syslog ", including the "syslog ip ..." line saved a moment earlier. The address then falls back to 0.0.0.0 on the next boot. It fails quietly: nothing is reported, the running switch keeps logging until it is restarted, and the loss looks like the firmware forgetting a setting rather than the page dropping it. Narrow the entry to the commands it is meant to collapse, so the address and the port keep their own entries and are no longer collateral. That alone would stop "syslog on" and "syslog off" from replacing each other, because the list drops lines starting with the text it matched and "syslog off" does not start with "syslog on". A separate list names the stem of such a pair and collapses the two, which is what the catch-all used to do by accident.