What's new

How to get firmware version from a script

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

sbsnb

Very Senior Member
I automate the task of backing up my router's config, JFFS, and Entware. I would like to also include the firmware version in the backup. I know it's in NVRAM stored as 3rd-party=merlin and innerver=3.0.0.4.386.2_6, which requires a little bit of script-fu to turn into a string like "Merlin-386.2_6."

Instead of reinventing the wheel I tried investigating how it's done for the page headers in the GUI, but that proved to be more difficult than I had imagined.

Any tips on where to look?
 
Don't use either of these. First one is not guaranteed to always exist (it's used by one internal service in newer versions), and the second one is used internally for, I believe, the update system. What you need is in the buildno and the extendno variables.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top