Posts by james

    Great! Thank you very much for the pointer!

    I adapted the idea to my needs, which leaded to this script:

    Bash
    #!/bin/sh
    poweroff=$(/usr/bin/systemctl list-jobs | egrep -c 'poweroff.target.*start')
    if [ ${poweroff} -gt 0 ]; then
       echo "power off system" > /storage/lastShutdown
       # code 4 NAS shutdown comes here
    else
       echo "rebooting system" > /storage/lastShutdown
    fi

    I love this solution! - I don't have to use self-compiled images and nas-handling works under the hood like desired.

    Perfect!

    Thank you for your valuable thoughts!

    I started experiments with shutdown.sh script cause shutdown.sh receives script parameters to differ between shutdown and reboot. autostop.sh does not have such parameters, therefore its not what I want.

    Any idea, how I could determine in autostop.sh whether system is going to shutdown or is going to reboot?

    Would it be possible to create a key-file by using LE-patch system?

    In script I could then check existance or better content of key-file ... ?

    Hi,

    recently i noticed that during shutdown some errors occur. When kodi disappears some red messages appear. However, the time until the display turns off is too short to read the messages.

    Have already installed rsyslog addon - unfortunately it changed nothing. No additional logfiles ...

    What else could I do to get rid of the shutdown errors or log the shutdown process permanently?

    Ok, its all about shutting down the nas.

    I use some nas for movie storage, which I turn on right before watching movies. When I'm finish watching movies I'd like to shutdown nas. Actually I use script-launcher addin for that purpose.

    The drawback is, that reason is ugly and its an additional step at shutdown process. I have to enable addin-category at media-main-menue and of cause my memory is far from reliable and so often I forget to execute the script and then have to poweroff the nas without shutting it down.

    I don't know whether just powering the box off could cause any harm ...

    In any case I don't like that praxis.

    Recently I read about shutdown-script in LE-wiki and thought, if I could change point of execution to before network shuts down, I could add the nas-shutdown to that script.

    That leaded to several tests. First I had to realize, that I can't change content of service-scripts.

    So I checked out LE-sources and started to build my own image.

    On that image I changed kodi-poweroff.service and kodi-halt.service and added a "requires=network-online.target" and enable both services by using systemctl enable ... - but I could not see any change. nas did not shutdown on shutting down kodi.

    So I added a "touch [somefile]" to shutdown.sh, but on next start the file has not been created - so I suspect, that shutdown.sh script is not going to be executed.

    I also thought about adding an entry to kodi-poweroff-menue. I found the patch-files that changes the menue-handling. Don't know, whether it would be possible, to add a menue entry.

    Best would be, to change current shutdown-process, so that I can't forget to shutdown nas.

    Looks like shutdown.sh is not executed at all.

    I added a touch [somefile] but that file does not appear.

    Same operation added to autostart creates the keyfile.

    I tried to enable kodi-halt.service and kodi-poweroff.service but that did not change anything.

    What am I missing?

    Hi,

    I read in LE-wiki that network already has shutdown when shutdown.sh runs.

    In other context I read, that dependency to network could be added by adding a line "Requires=network.target".

    I tried that with kodi-poweroff.service - but it does not make a difference.

    Can anybody tell me, how to get shutdown.sh run before network shutdown?

    Or if its not possible, could you explain the reason?

    Hi,

    just want to say "Thank you" to the developers that permanently work on improving LE.

    I tried a new nightly image and was thrilled by the amazing "new" sound.

    Same movie with an older nightly and a recent nightly same setup and configuration - difference like stereo to surround :)

    You guys do a pretty good job!

    Cheers

    I have similar setup.

    Nas is a rockpi4 Penta-Sata-Tower with 4 SSD in one room and raspberry pi4 in another room. I turn on the Nas, go to the other room and turn on beamer, amp and raspi (in that order) ...

    I don't have to wait for kodi to show the icons. Everything is available as expected (with more than 10Tb of data)

    Better check whether reboot is running.

    don't know how to do that.


    you can initiate a shutdown script on your NAS with some delay

    good idea, but far from being elegant ...

    So I asked in kodi-forum and a friendly user guided me to his plugin.

    You need to download it as zip-file and install from kodi by "install from zip-file".

    This plugin will create a menu from your command entries, where you can execute a script by menu-selection.

    Hi,

    I use autostop.sh to shutdown nas, but autostop.sh gets executed on reboot too.

    I'd like to avoid that.

    Is it possible to filter commands from autostop.sh like shown in the wiki for shutdown.sh?

    Hi,

    thank you very much for your attention.

    Well, I didn't want to sent a message to kodi.

    I tested various rpc-variants, but none of them worked on an official LE image and I didn't want to create my own image.

    Then I thought, may be I don't need rpc-method and I tried simple socket programming.

    A small python script that sends a socket message on LE and a compiled socket server on the receiver side.

    Works fine.

    Together with the autostop script of LE I can now shutdown my nas when I shutdown LE.

    Works as expected.

    Hi,

    I'm looking for a way to send a rpc-message from commandline.

    I tried to use a rpcclient compiled at armbian, but that did not work (of cause).

    Then I tried to use python, but python does not contain the rpyc or classic module ...

    I read, that its possible, to tweak kodi to use json-rpc, but that's no way for me.

    So what's the preferred way to send a rpc-message from libreelec?