Kodi Community Forum

Full Version: NAS Shutdown Script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Im in need of a script that can shutdown my NAS and i am happy to try and code it myself but i could do with a bit of direction/help

i own a MRT - 35HD-DUAL-NAS - SATA (SMB,FTP,NFS)

would it be possible for a simple script that accesses the web gui and enters the user/password and makes the appropriate menu selections to the shutdown button?

or would i need to know more about the NAS protocols in order to go about this via something other than the web GUI?

I look forward to any replys even if its to tell me its not possible so i can stop dreaming.


P.S there is an extreame lack of support for this product online so im not sure of its exact features. any tests sujested that i could perform on the NAS to clarify it abilities/protocols would be much appreciated.
If you can shutdown your nas over http it would seam that you should be able to find which variables you need to post to which script and that should work.

Shouldnt be more than 1 or 2 lines of code.

rudeboyx Wrote:Im in need of a script that can shutdown my NAS and i am happy to try and code it myself but i could do with a bit of direction/help

i own a MRT - 35HD-DUAL-NAS - SATA (SMB,FTP,NFS)

would it be possible for a simple script that accesses the web gui and enters the user/password and makes the appropriate menu selections to the shutdown button?

or would i need to know more about the NAS protocols in order to go about this via something other than the web GUI?

I look forward to any replys even if its to tell me its not possible so i can stop dreaming.


P.S there is an extreame lack of support for this product online so im not sure of its exact features. any tests sujested that i could perform on the NAS to clarify it abilities/protocols would be much appreciated.
the problem is that the web gui is in javascript so urls are not displayed with every movment through the gui
i get the url upto http://192.168.1.5/cgi/power/power.cgi but there are 2 buttons on screen (RESTART SERVER) and (TURN OFF SERVER) when highlighted or pressed no further urls are diplayed so i dont know what the final url is.


also if im not logged in then this url reverts me to the login page.
if i use http://username:[email protected]/cgi/power/power.cgi where username and password are filled in i get a (windows cannot find url error)
cheers for the link but iv already checked it. i am using that script as a base for mine but i still have no idea of the final url needed for my nas. is there any tools to display urls as you move through internet explorer pages?
rudeboyx Wrote:cheers for the link but iv already checked it. i am using that script as a base for mine but i still have no idea of the final url needed for my nas. is there any tools to display urls as you move through internet explorer pages?

Their are tools to track all activity of browser (acts like a proxy and outputs activity to a log window) - but the name of tool(s) escapes me. They are used by security guys (and hackers) to highlight issues with code and information sent by pages.

Using firefox and searching the hundreds of add ins my be more fruitful, somebodys bound to have created an add in to do what you need to find correct url.

Cheers
In general I would start with firebug , although I don't mess with cgi much.
sorry dont use fire fox. dont like cluttering up my pc with excessive apps. internet explorer comes built in, never had a problem withit so il never use anything else.
This shutdown script works for me, i'm not python programmer Smile

http://www.mediafire.com/?twktwfxmm3n

it shutdowns both, xbox and lacie.
http://www.mediafire.com/?whnftvbzybd

Package contain PM3 addition for shutdown nas button. And same script as earlier.

default lacie used dchp IP , change first it static.
then edit script default.py and change your ip and password.
example:
Base_URL = "http://admin:[email protected]/cgi-bin/admin/reboot?action=shutdown"