What's new

Adding NvRam settings.

  • 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!

So i have this script
[...save_nvram.sh...]
I haven't tried this on the router yet, just want to see what everyone thinks about this. I do want to clear the nvram stuff out but i don't want to have to manually put everything back.

Great stuff! I just tested the script, and it seems to do what it should do...

i think???? i got most of them anyone see what might be missing?

The first line of your script should echo the shebang - so you can use the new file (I call it "rest_nvram.sh" to be able to differ) immediately after saving the output of the script:

Code:
sh /tmp/mnt/DISK/Scripts/save_nvram.sh > /tmp/mnt/DISK/Scripts/rest_nvram.sh

file save_nvram.sh:
---------------------
#!/bin/sh
echo "#!/bin/sh"
echo nvram set vts_rulelist=\"`nvram get vts_rulelist`\"
[...]
---------------------

Ciao
Gerald
 
Great stuff! I just tested the script, and it seems to do what it should do...



The first line of your script should echo the shebang - so you can use the new file (I call it "rest_nvram.sh" to be able to differ) immediately after saving the output of the script:

Code:
sh /tmp/mnt/DISK/Scripts/save_nvram.sh > /tmp/mnt/DISK/Scripts/rest_nvram.sh

file save_nvram.sh:
---------------------
#!/bin/sh
echo "#!/bin/sh"
echo nvram set vts_rulelist=\"`nvram get vts_rulelist`\"
[...]
---------------------

Ciao
Gerald

'THanks good idea i used the script yesterday after resetting the nvram and it was actually useful to me too.

If it helps out one person then i guess it was a good idea.

The part of this that is so funky, is why is some much random stuff put into nvram? oh well just have to deal.
 
The part of this that is so funky, is why is some much random stuff put into nvram? oh well just have to deal.

There's nothing random. Everything in nvram is there for a reason. A lot is used by the firmware and bootloader to initialize the hardware, for example. Others are temporary vars (for instance, all the wl_* vars are what gets written by the webui, and then the firmware writes it to the appropriate instance, for example wl0_*).
 
There's nothing random. Everything in nvram is there for a reason. A lot is used by the firmware and bootloader to initialize the hardware, for example. Others are temporary vars (for instance, all the wl_* vars are what gets written by the webui, and then the firmware writes it to the appropriate instance, for example wl0_*).


I am sorry i said random, that was the wrong word. i was looking that the diffs of old/new nvram settings


1636c1652
< wl1_version=6.30.102.9 (r366174)
---
> wl1_version=6.30.39.31 (r341183)

seems weird that the version of the driver is stored in nvram, (okay maybe not weird, cuz its probably the version that wrote this stuff out)

I just re-read you post again. so it seems that non of the wl_* should be saved??
 
I am sorry i said random, that was the wrong word. i was looking that the diffs of old/new nvram settings


1636c1652
< wl1_version=6.30.102.9 (r366174)
---
> wl1_version=6.30.39.31 (r341183)

seems weird that the version of the driver is stored in nvram, (okay maybe not weird, cuz its probably the version that wrote this stuff out)

It's probably written by the CFE, for reference purposes (i.e. if any code in the firmware is version-specific, then they would have an easy way to verify it).

I just re-read you post again. so it seems that non of the wl_* should be saved??

Probably not, no. I'm just not 100% sure that these get filled before a page gets queried, it's been a while since I played with the code related to multi-instancing. That would have to be tested to confirm it.
 
I want to eventually include two simple script in the firmware that would allow one to save and restore some of those settings to save time when reconfiguring after a factory default reset. The scripts would take care of QoS, DHCP static leases, etc... I just haven't gotten around to it yet.

Was this every implemented please? It's still be really useful.
I have been using the commands but came across a recent issue where putty would not paste the full string length (about 1000 chars).

ta

k.
 
Was this every implemented please? It's still be really useful.
I have been using the commands but came across a recent issue where putty would not paste the full string length (about 1000 chars).

ta

k.

You realize you're replying to a post from 2013, right? :)

This hasn't been implemented yet, but for a while, we had john9527's awesome NVRAM Save/Restore script, but that hasn't been updated to work with the latest firmware properly.

There was some talk about the script developers here tackling this issue, but I haven't heard anything new on that front for a few weeks now.

PuTTY is limited in that regard. You will need to find another utility that isn't. ;)
 
You realize you're replying to a post from 2013, right?

Oh yeah I do; and I've been waiting all this time :).

I've been using the SSH/Putty method but came across an issue the other day where putty wouldn't allow me to paste the full length (now quite long) string into Putty to send the old "nvram set dhcp_staticlist "list".

I got it sorted using WinSCP and copying a file to the router itself which I could then nvram back directly using a file, but came across this and thought it'd be nifty to have a save/reload function, including a directory of icons ....

I can wait a wee while longer.

k.
 
dhcp_staticlist is limited to ~3000 characters now by firmware or even less (search for exact value).
 
Last edited:
By the way, XShell6 from NetSarang is a popular SSH client with developers on this forum. Perhaps that does not have the 1000 character limitation?

At $100 per year for a licence, XShell6 may not be the best value for money for most users.
 
By the way, XShell6 from NetSarang is a popular SSH client with developers on this forum. Perhaps that does not have the 1000 character limitation?
It's not a client limitation so changing the client won't make any difference.
Another consideration is that the router's input buffer is only 1022 characters, so any line longer than that will be truncated. I currently have 17 entries in my DHCP list which takes up 673 characters in NVRAM.
 

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