Hi guys!
I was messing around with this issue for almost two freakin' days right now. Since my APC is not supported from Buffalo and I didn't want to change the stock firmware I had to find a solution to be able to shut down or reboot our TeraStation remotely over a command-line utility. Actually it's a pity that Buffalo itself is not providing any API or tools for that issue..!
However, I finally found a solution. I've just recorded the HTTP transactions when I rebooted the device over the WebGUI and then simulated them with php and java.
Here is my PHP solution (requires php5 & curl):
- <?php
// login-process
$result = shell_exec('curl -d "bufaction=verifyLogin&user=[user]&password=[pasword]" http://[server]/dynamic.pl');
$cookie_id = substr($result,44,32);
echo $result."
";
// shutdown tera-station, if you want to reboot it change the shutdown part with reboot
$ch = curl_init("http://[server]/dynamic.pl?bufaction=shutRestartLS&action=shutdown&");
curl_setopt($ch, CURLOPT_COOKIE, "webui_session_admin=".$cookie_id."_en_0");
$output = curl_exec($ch);
curl_close($ch);
echo $output."
";
?>
I have also developed a Jar in Java, with which you can start a task over the command line like that:
- java -jar TeraStationControl.jar [server] [user] [password] [task]
If you want to have the Jar, please write me a private message.
Cheers
Goga