Posts by humdinger

    OK, here's the log: http://0x0.st/opx_.log

    I boot up, call the Power menu with a keypress on my remote control and select "Shutdown" from the menu. This does System.Exec() the above script.

    That said, it appears to me that Da Flex is right. From the log it looks like after invoking "Shutdown", kodi is kinda "un-pausing", doing HW inits etc.

    Also, with a trick I can make my scripts work: I just sleep for 2 seconds before sending the kodi-send commands, which is enough for Kodi to be attentive again and react to those commands. For that to work, the script has to immediately return and do the sleeping in the background. For that I moved everything into a function.

    That's the working script:

    Though it's working, I'd be willing to experiement further, if you guys come up with things to try...

    Thanks so far!

    You misunderstood. There's actual weirdness happening...

    There's no shutdown progress going on. I just replaced the "Shutdown" item of the Power menu (that normally calls the kodi build-in "Powerdown()") with a System.Exec() call of the above script. No shutdown is initiated.

    My script just determines if there are downloads queued (my sytem generates a file /tmp/downloadflag when that's the case). If there are, kodi is made to show a notification, otherwise the regular kodi command to Powerdown() is triggered.

    If I execute this script when logged in via SSH, it works as expected. If I System.Exec() that script from a normal menu in Kodi, it works, too. Only if I System.Exec() from the "Power" menu it does not work.

    Weird.

    Hi there.

    Got another issue... :)

    I have a simple bash script that works when added as a menu item to a regular submenu, e.g. Settings. The script is executed as 'custom command' with System.Exec(). If I instead create the menu item calling the script in the "Power" menu, it does not work.

    This is the script:

    Bash
    #!/bin/bash
    
    # Check if anything gets downloaded and prevent shutdown
    # Set this script in Kodi's Power menu with "System.Exec()"
    
    if [ -e /tmp/downloadflag ] ; then
            kodi-send --action="Notification(Download in progress,Shutdown aborted!,20000)"
    else
            kodi-send --action=Powerdown
    fi

    If I insert a touch ~/EXECUTED before the kodi-send line, that file gets created alright, so the script does get called. It seems like it's really the "kodi-send" that doesn't work.

    Any ideas why that may be?

    Thanks!

    Hi humdinger - wget is part of busybox on LibreELEC as an intentional minimal install. (The curl installation on LibreELEC is the full curl implementation.)

    Thanks, heitbaum, I forgot about curl...

    curl -I provides an output I can parse for the file size. Good enough for me. :)

    Da Flex: I don't have an installed RaspberryOS around anymore. I'm also not much of a linux user and wonder if simply moving the wget command over to my LibreElec install will even work.

    Anyway, my biggest issue is solved, and if we cannot have a fully fledged wget, curl will do.

    Thanks all.

    Hello there!

    I had a script using wget when I was running Kodi on RaspberryOS, but have since moved to the latest LibreElec v10.0.2.

    LibreElec's wget doesn't give the info (esp. file size) when called with the --spider parameter, nor does it log as verbatim, or accepts an input file (and probably a million more parameters :) )

    I cannot tell the version of wget, it appears to be part of BusyBox v1.32.1. Can wget be updated in some way? Or can a newer wget packaged with the System Tools addon?

    Thanks!