NAS Shutdown Script

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
rudeboyx Offline
Posting Freak
Posts: 750
Joined: Dec 2007
Reputation: 0
Location: Burnley, UK
Thumbs Up  NAS Shutdown Script
Post: #1
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.
(This post was last modified: 2009-01-22 18:12 by rudeboyx.)
find quote
nate12o6 Offline
Senior Member
Posts: 137
Joined: Dec 2006
Reputation: 0
Post: #2
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.
find quote
rudeboyx Offline
Posting Freak
Posts: 750
Joined: Dec 2007
Reputation: 0
Location: Burnley, UK
Post: #3
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:password@192.168.1.5/cgi/power/power.cgi where username and password are filled in i get a (windows cannot find url error)
(This post was last modified: 2009-01-22 19:05 by rudeboyx.)
find quote
sipart Online
Senior Member
Posts: 122
Joined: Jan 2008
Reputation: 0
Location: Derbyshire UK
Post: #4
This thread might help?

http://forum.xbmc.org/showthread.php?tid...erid=30016
find quote
rudeboyx Offline
Posting Freak
Posts: 750
Joined: Dec 2007
Reputation: 0
Location: Burnley, UK
Post: #5
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?
find quote
sipart Online
Senior Member
Posts: 122
Joined: Jan 2008
Reputation: 0
Location: Derbyshire UK
Post: #6
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
find quote
colejv Offline
Junior Member
Posts: 7
Joined: Oct 2008
Reputation: 0
Post: #7
In general I would start with firebug , although I don't mess with cgi much.
find quote
rudeboyx Offline
Posting Freak
Posts: 750
Joined: Dec 2007
Reputation: 0
Location: Burnley, UK
Post: #8
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.
find quote
mikko70 Offline
Member
Posts: 80
Joined: Mar 2007
Reputation: 0
Post: #9
Lacie Network Space 1TB

shutdown:
http://admin:admind@192.168.0.xxx/cgi-bi...n=shutdown

reboot:
http://admin:admind@192.168.0.xxx/cgi-bi...ion=reboot

xxx= Lacie IP
find quote
mikko70 Offline
Member
Posts: 80
Joined: Mar 2007
Reputation: 0
Post: #10
This shutdown script works for me, i'm not python programmer Smile

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

it shutdowns both, xbox and lacie.
find quote
mikko70 Offline
Member
Posts: 80
Joined: Mar 2007
Reputation: 0
Post: #11
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:admin@192.168.0.33/cgi-bin/admin/reboot?action=shutdown"
(This post was last modified: 2009-01-31 18:40 by mikko70.)
find quote