NASLite Network Attached Storage

www.serverelements.com
Task-specific simplicity with low hardware requirements.
It is currently Thu Apr 25, 2024 5:22 am

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: sleep-on-LAN
PostPosted: Fri Nov 12, 2010 8:33 pm 
Offline

Joined: Fri Nov 12, 2010 8:22 pm
Posts: 2
I have managed to get my backup software (SyncbackPro) to Wake-on-LAN my NASLite-M2 server and carry out the necessary file transfers. :D

I cannot find a way to send a command to the server to shut it down. There are some old references to this problem on this forum, dating back to 2007, IIRC, but all the links to the software are broken. :cry:

Does anyone have this working on their systems or know how it is done?

TIA.

Jon


Top
 Profile  
 
 Post subject: Re: sleep-on-LAN
PostPosted: Sat Nov 13, 2010 3:41 am 
Offline

Joined: Sun May 27, 2007 5:38 pm
Posts: 517
Location: gods own country
assuming you are on windows create a file called close.vbs - or whatever name you want

and copy and paste the text below into it

Quote:

ServerName = "192.168.1.21"
Username = "admin" ' Current Username
Passwd = "nas" ' Current Password

XIT = "E" ' Used to "EXIT" from NAS. (upper-case E)
YES = "y" ' Used to confirm an option. (lower-case Y)
SHUT = "8" ' Used to SHUTDOWN NAS. (number eight)

DELAY = 500 ' Minimum 500ms recommended; 1000 works well.


' --------------------------------------------------------------------
' SECTION B: Start a Shell
' --------------------------------------------------------------------
Set WshShell = WScript.CreateObject("WScript.Shell")


' --------------------------------------------------------------------
' SECTION C: Start the TELNET
' --------------------------------------------------------------------
WshShell.Run "telnet " + ServerName

' --------------------------------------------------------------------
' SECTION D: Login. ("Sleep" pauses are needed delays.)
' --------------------------------------------------------------------
WScript.Sleep DELAY
WshShell.SendKeys Username + vbLf
WScript.Sleep DELAY
WshShell.SendKeys Passwd + vbLf
WScript.Sleep DELAY
WshShell.SendKeys SHUT + vbLf
WScript.Sleep DELAY
WshShell.SendKeys YES + vbLf
WScript.Sleep DELAY
WScript.quit





alter the server name to whatever you have set it to and run it - you need to have Telnet client switched on in programs for it to work

if you want to run the config menu from the server - run this - again altering the ip address and saving it as a .vbs file

Quote:
ServerName = "192.168.1.21"
Username = "admin" ' Current Username
Passwd = "nas" ' Current Password

XIT = "E" ' Used to "EXIT" from NAS. (upper-case E)
YES = "y" ' Used to confirm an option. (lower-case Y)
SHUT = "8" ' Used to SHUTDOWN NAS. (number eight)

DELAY = 500 ' Minimum 500ms recommended; 1000 works well.


' --------------------------------------------------------------------
' SECTION B: Start a Shell
' --------------------------------------------------------------------
WScript.Timeout = 1

Set WshShell = WScript.CreateObject("WScript.Shell")


' --------------------------------------------------------------------
' SECTION C: Start the TELNET
' --------------------------------------------------------------------





WshShell.Run "telnet " + ServerName



' --------------------------------------------------------------------
' SECTION D: Login. ("Sleep" pauses are needed delays.)
' --------------------------------------------------------------------
WScript.Sleep DELAY
WshShell.SendKeys Username + vbLf
WScript.Sleep DELAY
WshShell.SendKeys Passwd + vbLf

WScript.Quit



i should give credit to the author - i believe it was georg - they may not be exactly as he wrote them, i believe someone else modified them and i have played with them [a little] but my input was negligible


Top
 Profile  
 
 Post subject: Re: sleep-on-LAN
PostPosted: Sat Nov 13, 2010 12:33 pm 
Offline

Joined: Fri Nov 12, 2010 8:22 pm
Posts: 2
Thanks Tony, that is exactly what I was after. And thanks to the original scribe, georg.

jonl


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 68 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group