startup screen not showing the download progress

  • Hi
    i have written the following shell script it will download the latest nightly build from the mirror url

    When i run from the terminal it is showing download progress but when executed from .config/autostart.sh it only show the printf statement context in startup screen but will it be possible to see the progress in the startup screen Please help with this

    script---->.config/autostart.sh

  • LE executes /storage/.config/autostart.sh at the start of userspace boot long before the network is brought up. As a result the script logic will always return "Internet is not available. Exiting without download." making the script (as-is) pointless.

    The low-skill approach to scheduling the script to run later in the boot sequence is to "(background)&" execution and use a sleep command (10s is normally enough). This will ensure the script works, but Kodi will have already started so there's no point trying to redirect messages to the console TTY for on-screen display alongside the LE boot splash which is quickly overwritten with the Kodi boot splash then home screen; although often that happens quickly so you only see the home screen.

    The better approach is to schedule script execution with a systemd service as this supports dependencies; you can dependen on network-online.target to ensure the network is up and avoid the ping-Google check. If you further depend on kodi.target you can also use kodi-send to show a toaster notification in the Kodi GUI, e.g. "Image Downloading.." and then "Rebooting in 5 seconds" or such before you force reboot to update. Have a look at the example wireguard.service in /storage/.config/system.d/ for something similar to what you need. Beware that systemd does not inherit $PATH so you must use /full/path/to/binary in commands.

  • I have renamed the above script with version_update.sh and created .config/autostart.sh with sleep for 60sec

    cat .config/autostart.sh
    #!/bin/sh

    sleep 60 # Delay execution for 1 minute
    /storage/version_update.sh

    this time during the startup screen it shows "Internet is available." and it is started downloading the file under .update folder but it is showing the download progress on the screen

    ------code for to show the progress bar
    Download the latest file with progress bar
    curl -# -o /storage/.update/"$LATEST_FILE" "$URL$LATEST_FILE"

  • autostart.sh is depending on network-online.target but you have to adjust Wait for network before starting Kodi in LE-Settins addon from the initial short 10 seconds to your needs.

    Log messages of autostart.sh can be viewed with journalctl -u kodi-autostart. The status of "Wait for network" is visible with systemctl status kodi-waitonnetwork

  • There is no issue with script for downloading, if there is any latest version of 13.0 nightly build while booting up, it will download and update after the reboot.

    only issue i see is download progress bar not show on the screen during the download

    command used in the script

    ------
    curl -# -o /storage/.update/"$LATEST_FILE" "$URL$LATEST_FILE"