Manipulating nvram and rebooting via web

6 posts / 0 new
Last post
mycal
mycal's picture
Manipulating nvram and rebooting via web

 

Is there a current web API for reading and writing nvram variables via the webserver?

I'm looking at the asp_handler.h, and I'm guessing that each line in asp_handler.h is an index that corralates to a values specified in the HTML to fill in, for example.

index 12 is  {"nvram_get(\"wan_proto\");", NULL},)

to fill this value from nvram in the html you would:

<INPUT name=wan_proto type=hidden value= "<%12%>">

I see some form targets are things like "ether.cgi" but I cannot seem to find were these are generated or how to make my own.

 

So having said all that, now can I manipulate my own variables using this interface?  Also controling reboot would be good.

 

Thanks,

M

 

 

 

 

mycal
mycal's picture
This is for the MOR firmware.

This is for the MOR firmware.

Nachi
Nachi's picture
Thought I did a response -

Thought I did a response - but looks like finally it was not posted.
Hope you managed to change the nvram variable? If so please share your experiences.

You seem to be on the right track - but unfortunately the cgi code is not open so even with this interface the web interface will be pretty much limited.
You may also try your hands with other open source options.

mycal
mycal's picture
No never got it. Not going

No never got it. Not going to worry about it. If it needs to be modified it will be up to you guys as the Demo is in Netgear's hands now.

But I will have to say the MOR firmware is a dead end if you cannot do this or at least have a way to add your own CGI.

Nachi
Nachi's picture
If by MOR firmware you mean -

If by MOR firmware you mean -

http://www.myopenrouter.com/download/10360/Source-Code-WGR614L-MyOpenRou...

then the cgi interface is wide open and is easy to modify.

While the Router itself is a good hardware platform for developing open source code and running dd-wrt or tomato, Netgear's preloaded retail version of firmware is not really for the open source community.

john bartas
john bartas's picture
Let me try to resurrect this

Let me try to resurrect this old thread....
I got as far as mycal with the web server -> nvram link, but I'm not sure how the asp_handler.h gets included in the C code - I grepped through the whole MOT tree and didn't find it included anywhere. Anyone know how this works?