Can LuCI please leave comments in config files?


I've got some feedback. When I edit the /etc/config/ files, e.g. network, firewall, wireless via WinSCP or nano editor, I often put comments between the lines.

# wifi-client 1 Max Defaultman Samsung device
list ' ... '

Those comments are removed when I edit the same configuration via LuCI web interface. The rest of the custom options or contents stay there fine.

I'd like to ask if comments can be preserved. My git also sees the removed comments and I need to put them back manually every time I edit via LuCI.

Thank you.

Kind regards,

That would require an improved parser, instead of simple (re)generating new files, feel free to create one.

1 Like

This is not possible as the underlying libuci library dealing with the files does not support this. It would have to be changed in OpenWrt itself.

1 Like

You can do this by creating a list of comments with a new list element for every comment line you want to add eg
list ...........comment 'This is a comment'


Cool idea, thank you :slightly_smiling_face::cat2::+1:

I've tried this. But it doesn't do anything better for git config archival. The "list comment 'xxx'" rows jump from in-between to the top of the config block part when I hit "save" in LuCi.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.