Hello
I have written a service for Kodi. I tested it on Windows 7 32bit and Kodi 13.2
You need to have .NET 4.0 installed because i use a win32.exe to execute remote commands.
Maybe in future i'm able to get this to work in python.
Extract
https://dl.dropboxusercontent.com/u/2116...Client.zip this zipfile to your Kodi addon directory. In my case because i use the portable mode c:\Program Files (x86)\XBMC13\portable_data\addons
Go into the directory service.SSHClient and open default.py with you favorite texteditor.
you find 3 #subprocess... lines. comment out by deleteing the # when the script should start.
e.g. Shutdown your NAS when KODI reboots the method looks like
Code:
def onNotification(self,sender, method, data):
if method == "System.OnQuit":
if data == "0":
#KODI quits
xbmc.log("SSH Client:KODI quits")
# "host" "user" "pass" "command"
#subprocess.call('"' + __addonpath__ + '\exe\EXESSH.exe" "192.168.1.1" "root" "mypass" "shutdown -h now"', shell=True)
elif data == "64":
#KODI shutdown
xbmc.log("SSH Client:KODI shutdown")
#subprocess.call('"' + __addonpath__ + '\exe\EXESSH.exe" "192.168.1.1" "root" "mypass" "shutdown -h now"', shell=True)
elif data == "66":
#KODI reboot
xbmc.log("SSH Client:KODI reboot")
subprocess.call('"' + __addonpath__ + '\exe\EXESSH.exe" "192.168.1.1" "root" "mypass" "shutdown -h now"', shell=True)
At last fill in your host,user,pass and your shutdown command.
If you have any issues or some feedback let me know.