search

Auto Remote Shutdown

Have you ever wanted to be able to shut down your GoFlex Home in a batch script?

Neither have I, but a user on the old Seagate forums was running several GoFlex Home devices on a UPS and wanted a way to shut down the devices elegantly when the power went off, triggering a Command Line Event  


Roby B from Axentra suggested using the Hipserv API and made available some lib scripts. I felt like a challenge so I tinkered with it and put together the attached file which somebody might find useful.
  
You can download the file here hipserv_Shutdown_LAN 

Extract the Hipserv_Shutdown_LAN.php file somewhere and edit the first few lines (notepad will do) for your own IP address, username and password.

//This script will shut down your HipServ on a LAN
// Edit "192.168.0.XX", "username" and "Password" to match your GoFlex Home details

$IPaddress =  "192.168.0.XX";     //your GoFlex Home's LAN IP address
$username =   "username";          //your GoFlex Home user name
$password =   "password";          //your GoFlex Home user password

You will also need to download the PHP distribution package and add the location to your PATH environment variable. Tips on how to do that can be found here .

Then, for example, if PHP is in C:\PHP5 and the Hipserv_Shutdown_LAN.php is in C:\Hipserv then you should be able to run the command


C:\PHP5\php.exe -f "C:\Hipserv\Hipserv_Shutdown_LAN.php"

Sadly there's no way to turn the device ON remotely. You have to press the button.

And yes, you could do it just as easily using the command line connection tool "Plink" but it would mean exposing your password in the command line. Using the Hipserv API and php, at least it is hidden away in the php file.

No comments:

Post a Comment