How to get current run config - made stupid mistake

Always check what you do, by mistake typed rm /etc/config/network instead of nano /etc/config/network

I am still connected via SSH, is there a way to write the current running config to the /etc/config/network file?

Try

uci export network > /etc/config/network

Thanks, but that seems to just read the file

uci: Entry not found

Sorry, apparently it doesn't work as I thought.

In your situation, I would generate a default /etc/config/network file running /bin/config_generate and try to restore as much as possible before restart.

1 Like

No worries, already recovered an older backup and added my latest changes. Was just hoping for an easier fix.

1 Like

You can always copy from /rom/etc/config/network. That's always available (read-only SquashFS).

There is no ROM /etc/config/network. That file doesn't exist at all in the distribution firmware, it is created by a script which runs during the first boot.

The ROM versions are useful for some files that don't vary between models, like DHCP and firewall.

2 Likes

My bad, you're right. It's per-device and generated at first boot.

1 Like

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