I finally got annoyed enough with having to start up firefox just to tell my 3g router to connect or disconnect that I spent some time trawling through the javascript and tcpdumps to figure out how to tell the thing to connect and disconnect. The following will only work on Linux (and other suitably Posixy) systems, although it shouldn't be hard to find something equivalent for Windows.
wrtconnect.sh:
wrtdisconnect.sh:
If you don't want to type your password in every time, you can replace the "read ... WRTPWD" line with:
It's not perfect, although I suspect the limitations are on the server side. After calling one of the scripts, the web insterface will be unresponsive for several seconds. I hope someone else out there finds this as useful as I do.
wrtconnect.sh:
Code:
#!/bin/bash
read -s -p "Please enter your router password: " WRTPWD
curl -o /dev/null -# -d submit_button=index -d change_action=gozila_cgi -d submit_type=Connect_wwan http://admin:${WRTPWD}@10.0.0.1/apply.cgi
wrtdisconnect.sh:
Code:
#!/bin/bash
read -s -p "Please enter your router password: " WRTPWD
curl -o /dev/null -# -d submit_button=index -d change_action=gozila_cgi -d submit_type=Disconnect_wwan http://admin:${WRTPWD}@10.0.0.1/apply.cgi
If you don't want to type your password in every time, you can replace the "read ... WRTPWD" line with:
Code:
WRTPWD=yourpassword
It's not perfect, although I suspect the limitations are on the server side. After calling one of the scripts, the web insterface will be unresponsive for several seconds. I hope someone else out there finds this as useful as I do.