shell script to get the latest nightly (old)

  • The URIs in the 11.0 directory are the proposed end state (except Generic and RPi)

    The 10.0 directory will be the same.

    The directories for Generic and RPi (should be)

    11.0/RPi/RPi2

    11.0/RPi/RPi4

    11.0/Generic/Generic

    11.0/Generic/Generic-legacy

  • Now that v0.10 is missing in action, I tried to create a much much simpler script that would just download the latest available nightly in the .update folder. And since my scripting abilities are weak, I decided to provide the commit name by hand, i.e. the script will ask the user to enter it manually.

    But I am having issues getting the date part. On my end, new nightlies (99% of the time) have yesterday's date, e.g. right now its 20220719 on my end and the latest nightly is from 20220718.

    Getting that date on my pc is easy peasy

    Code
    $ date --date=yesterday +%Y%m%d
    20220718

    But on le, where date is part of busybox, the above is not doable, although it supposedly supports the --date parameter!

    Code
    # date --date=yesterday +%Y%m%d
    date: invalid date 'yesterday'
    
    # date --help
    BusyBox v1.32.1 (2022-07-18 22:30:02 UTC) multi-call binary.
    
    Usage: date [OPTIONS] [+FMT] [TIME]
    ...
    -d,--date TIME  Display TIME, not 'now'
    ...

    There is a workaround for it that simply gets today's date output from %s and substracts 84600 seconds so as to get yesterday's date. This is the only documented solution I have found, which does get it right when using seconds, but I can not get it to output the date as I said above!

    Code
    # date -D %s -d $(( $(date +%s) - 86400 ))
    Mon Jul 18 09:02:11 EEST 2022
    
    # date -D %Y%m%d -d $(( $(date +%s) - 86400 ))
    date: invalid date '1658124175'
  • Now that v0.10 is missing in action ...

    My plan is to release the new script soonish, maybe in some hours.

    I just need to test what I can test here: Generic-legacy and dry run tests for RPI*.

    I'll open a new thread then.

    If you're able to come up with a better solution, I could wait ...

    your date problem was discussed here:

    GDPR-7
    July 4, 2022 at 12:33 AM

    comment #6

    Edited once, last by GDPR-7 (July 19, 2022 at 4:00 PM).

  • My little "it's something" script! I know it lacks a lot compared to yours, but it is all I can do.

    Bash
    #!/bin/bash
    source /etc/os-release
    echo You are on $VERSION for $LIBREELEC_ARCH
    read -p 'Date ' thedate
    read -p 'Commit ' thecommit
    echo Downloading image $thedate-$thecommit
    wget --spider https://test.libreelec.tv/11.0/$LIBREELEC_PROJECT/$LIBREELEC_DEVICE/LibreELEC-$LIBREELEC_ARCH-11.0-nightly-$thedate-$thecommit.img.gz
    #mv *.img.gz .update/

    If anyone wants to test it, please uncomment the line with mv and remove the --spider option from wget. They are the script's "safety pins".

    Edited once, last by jim_p (July 19, 2022 at 6:26 PM).

  • new version

    GDPR-7
    July 19, 2022 at 6:50 PM