Windows NAS

  • Hi, I have a windows NAS with all my files, I am able to wake the Server with Wake on LAN Plugin on Kodi but now I need to be able to shutdown the windows machine from Kodi.

    Is there any script or plugin in which I can put IP address, Username & password to shutdown the windows machine?

    Appreciate your help.

    Cheers

  • Hi, thanks for your reply but I'm actually looking to shutdown Windows Machine from Kodi, no the other way around. in a full Kodi Installation on Linux you can do it with net rpc shutdown -I 192.168.1.101 -U gordus%password.. the thing is that net rpc is not available in libreelec and I cannot do a sudo apt-get install samba-common for example.

    Therefore what I need is an Script or plugin that allows to shutdown a windows PC from within Kodi in libreelec.

    Cheers

  • Hi,
    You can try to port the "net" binary to libreelec by saving it in (for example) /storage/.config and try to run the executable, if there is show a messages of missing library copy also the missing library, to permit the system to know where library is create a startup.sh in /storage/.config contain:

    Code
    #! /bin/sh
    (
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/your/library
    )&


    or add the previously line if you have already your startup script;

    And for shutdown the remote system create also a shutdown.sh script and put the command you post: "net rpc shutdown -I 192.168.1.101 -U gordus%password..".
    I'm interested too with this functionality, I'll try to create a plugin (no warranty about how many time I'll spend on this project because I had ever do a plugin :P)

  • Hi thank you very much for your answer, Unfortunately I have no Idea how to do the port. I was looking for a download of samba-common and did not find it. I also try to find the net.?? on ubuntu and did not find it :(

    I'm sorry I'm more a windows than a linux guy, therefore if you can guide me on how to do it I'll be very grateful.

    By the way I also tried installing OPENSSH on My windows NAS and besides it works if I do a ssh 192.168.0.12@user shutdown /s /f from librelec shell when I do it from shutdown.sh script it does not work.

    SO whatever solution you guys can provide it will be greatly appreciated.

    Cheers

  • Hi, since the port of SMB-common was kind of difficult for a linux Newbie this is what finally worked for me:

    • Installed on my Windows Nas this software Bitvise: SSH software for Windows which is a reliable SSH server for windows since Open SSH didn't work either.
    • created a user on bitvise SSH and imported the Public Key previously created in LE.
    • in order to add the Host to the trusted Host file on LE I connect to LE via Putty (SSH) then from LE did an ssh [email protected]. it will ask to add the host and the ssh is done using Pub key previously added.
    • since it worked without asking password I then added the full command on my shutdown.sh script: ssh [email protected] shutdown /s /f
    • Done, LE shutdown and NAS shutdown.


    Thanks to all for your help and point me in the right direction.

    Cheers