[REQUEST] SOL (Shutdown On LAN) python script
#16
He wants WOL for his XBOX, not PC.
42.7% of all statistics are made up on the spot

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#17
WOL for the XBOX is impossible as that requires hardware support.

SOL for the XBOX is trivial via the httpapi (have webserver on in the client xbox)

Code:
import urllib
XBOX_IP = "192.168.1.1"
urllib.urlopen("http://"+XBOX_IP+"/xbmcCmds/xbmcHttp?command=Shutdown")
Reply
#18
nm
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#19
Hi,

When i start xbmc my pc (with just freenas installed) boots automaticly with the Wake up On Lan (WOL) pyhton script.Nod
Now i have to shutdown Freenas in the web interface but i like to shutdown the Freenas server in XBMC with a Phyton script.

I'm not a programmer at allBlush, i found some code like this:

import urllib
urllib.urlopen("http://192.168.1.105:80/shutdown.php")

Is this the way to do it? Does somebody have, or can programm the script for me?

thanks i.a.

Ron
Reply
#20
here you wil find a link to the source code of freenas shutdown.php
http://www.koders.com/php/fid375FEFFF568...6F25D.aspx
Reply
#21
http://www.xbmcscripts.com/index.php?opt...onLAN v0.1

http://www.plusminusnull.de/sol/

You will of course need to modify it to make it work with FreeNAS
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#22
Anavatos Wrote:here you wil find a link to the source code of freenas shutdown.php
http://www.koders.com/php/fid375FEFFF568...6F25D.aspx

I suggest you ask over at the FreeNAS forums for a URL that will send a shutdown command to the FreeNAS server.

Once you have that URL, and you have tested it works on your FreeNAS server, post it in here.

Cheers Nick
Reply
#23
I didn't add any of the gui elements (I have only made a plugin), but this should do it I think:
http://pastebin.com/m1f988591
Reply
#24
Hi Bashwork,

thank you for your reply!

I installed your plugin (default.py) in the plugins/video dir, on my xbox
When the virutal keyboards appear i enter my NAS IP: 192.168.1.105
But I get a 404 error unauthorized.

Since i'm a newbee with Freenas an XBMC plugins, i don't know what to do yetRolleyes i'm also not a programmer

Has it something to do with username/password/ account settings in Freenas?

I really like to work with freenas because SMB dvd streaming is very stableNod

thanks again.

bashwork Wrote:I didn't add any of the gui elements (I have only made a plugin), but this should do it I think:
http://pastebin.com/m1f988591
Reply
#25
Quick Python Script for FreeNAS Shutdown and Reboot.

ShutDownFreeNAS.py
Code:
# Shutdown FreeNAS Server
#
# v0.1 ozNick
# (URL ref. FreeNAS knowledgebase)
#
# Adjust admin username, password and ip_address as required


import urllib
WebSock = urllib.urlopen("http://admin:[email protected]/exec_raw.php?cmd=shutdown%20-p%20now")

RebootFreeNAS.py
Code:
# Shutdown FreeNAS Server
#
# v0.1 ozNick
# (URL ref. FreeNAS knowledgebase)
#
# Adjust admin username, password and ip_address as required

import urllib
WebSock = urllib.urlopen("http://admin:[email protected]/exec_raw.php?cmd=reboot")


Cheers Nick
Reply
#26
Please do share:
http://www.xbmcscripts.com
http://code.google.com/p/xbmc-addons/

Sharing is caring Big Grin
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#27
great work!

ThanksNodNod

I run the autoexec.py to start up the freenas server.
Is there also a possibility when i shutdown xbmc/xbox it will run your shutdown script?

Regards,
Ron

ozNick Wrote:Quick Python Script for FreeNAS Shutdown and Reboot.

ShutDownFreeNAS.py
Code:
# Shutdown FreeNAS Server
#
# v0.1 ozNick
# (URL ref. FreeNAS knowledgebase)
#
# Adjust admin username, password and ip_address as required


import urllib
WebSock = urllib.urlopen("http://admin:[email protected]/exec_raw.php?cmd=shutdown%20-p%20now")

RebootFreeNAS.py
Code:
# Shutdown FreeNAS Server
#
# v0.1 ozNick
# (URL ref. FreeNAS knowledgebase)
#
# Adjust admin username, password and ip_address as required

import urllib
WebSock = urllib.urlopen("http://admin:[email protected]/exec_raw.php?cmd=reboot")


Cheers Nick
Reply
#28
I was thinking of setting the freenas server to automatically shutdown every night at like midnight. Then you wouldn't have to worry about it. And if you have more than one xbox, if someone turned one off, the server would still be running for the other. Just a thought.

I actually didn't know about stating freenas with WOL and a script. I am going to check it out when I get home. Smile That is why I am not sure about the shutdown. I did look it up and it looks like it should work though.

J_K_M_A_N
Reply
#29
So which script do you use? Also, does it just wake it or does it ask you if you want to wake it? I would like it to wake it as soon as I boot into xbmc myself. Just curious.

J_K_M_A_N
Reply
#30
J_K_M_A_N Wrote:So which script do you use? Also, does it just wake it or does it ask you if you want to wake it? I would like it to wake it as soon as I boot into xbmc myself. Just curious.

J_K_M_A_N

The first one is for shutdown - the second one is to reboot (The comment says shutdown but I couldn't change it once it is posted).

The Wake on LAN scrpit I use is just the standard WOL script for any PC. It can be put in your autoexec.py to send the "magic" packet to the FreeNAS server on boot up of XBMC.

In the case of 2 XBoxes your idea of the auto shutdown at a predetermined time is a feature of FreeNAS.

Alternatively you could write a script for the FreeNAS server that pings your XBoxes and when it can't reach either of them after a period of time (say 10 mins) it would shutdown.

Cheers Nick
Reply

Logout Mark Read Team Forum Stats Members Help
[REQUEST] SOL (Shutdown On LAN) python script0