2
1
I want to be able to run some kind of shell script/curl commands to toggle my TV services by accessing a form on my router page using curl or wget.
I have been able to get past authentication using the -u username:password on the command line; Got to the critical page using
/index.cgi?page=services&sessionid=X6dRAsbOxWh9sc9llfGngL9lH4rQOsA>
(I have tried it without the sessionid parameter and the -u and it works)
I have got far enough to be able to set HTML controls, but somewhere a save button calls a piece of JavaScript. I know that the name of the option button is "services" and the value can be 0 or 1, but I dont know how to call the FormSubmit('butt2') in order to submit the values. I can initialize a cookie jar … I seem to be so close but executing the script with the the values set and the right parameter 'butt2'
Please help
Desperate Dad
You'll need to somehow recreate what the Javascript snippet is doing, which probably isn't all that hard -- likely it's just doing form validation. If you'll find that snippet (defined either in the source of the page you're trying to submit, or in a Javascript file included via <script> tag from there, as
function FormSubmit(...)
), and edit the entirety of that function into your question, that should be enough to let me give you a worthwhile answer. – Aaron Miller – 2013-05-08T22:18:43.030