Unfortunately, I couldn't download the attachment to try it out on the CH3WNAS. I asked the author to resubmit his binaries. Maybe for a next post...
There is also shutdown-option in the web-admin pages. After logon, the shutdown is done by firing a POST /goform/sysShootDown request onto the CH3WNAS. After some searching in the sourcecode (download it from the conceptronics' site), I found out that CH3WNAS_GPL/goahead/LINUX/web_api.c handles the shutdown:
void sysShootDown(webs_t wp, char_t *path, char_t *query)--> A simple (but unconventional) touch /tmp/shutdown triggers the shutdown. I suppose it's the same chkbutton daemon process that monitors and picks up the /tmp/shutdown file.
{if( checkIdleTime(wp) == WEB_IDLE_TIMEOUT )}
{websRedirect(wp, T("web/login.asp"));}
return;
system("touch /tmp/shutdown");
websRedirect(wp, T("web/tools/shutdown.asp"));
If you need to do a fast remote shutdown, you can exercise the existing web-interface from command line (the wget is standard under linux; under windows, have a look at wget for windows):
wget -o /tmp/test "http://192.168.1.30/goform/formLogin?f_LOGIN_NAME=admin&f_LOGIN_PASSWD=xxx&f_login_type=0"Replace the ip & password according to your local setup. Put those commands in a script and you get a simple way to shutdown the unit remotely with a simple double-click. The problem with this code is that you have to put your admin-password in cleartext on your pc. I haven't figured out yet how to circumvent the logon page to remove this security-issue.
wget -o /tmp/test2 "http://192.168.1.30/goform/sysShootDown"
No comments:
Post a Comment