shell script to get the lastest nightly

  • as a command line user I wrote a shell script to download nightlies for updates/downgrades

    script supports the newer directory structure on the nightly download server and LE 11 nightlies.

    What is does

    - reads out /etc/os-release to get the nightly variant from your currently running LE box

    - checks the download server for last (for updates) and previous (for downgrades) nightlies

    where "updates" means: to the newest on the download server (in one step ! I don't know if that always work out)

    where "downgrades" means: one nightly down related to the currently running

    - checks need disk space (min. ~549 MB) what the update installer needs

    and only when okay it does the next 2 steps:

    - downloads the choosen nightly Image from the download server and places it under ~/.update

    - offers to reboot

    What it doesn't do

    - does (currently) NOT support boxes which are NOT Generic, Generic-legacy, RPi2, RPi4

    - does NOT support switching between Generic and Generic-legacy nightlies


    Requirements

    - always run the lastest script version.

    - you need at least a nightly on your LE box what is also currently available on the download server (URL: please see script line 44: "SERVER"), otherwise the script aborts !

    Background: if the script can't find your running nightly on the download server it can't decide what is the update/downgrade related to your box.

    HowTo

    1. download via webbrowser from here:

    2. https://gist.github.com/eldersixpack13

    - don't be confuse: eldersixpack13 and JoeAverage are the same (idiot)"

    3. unzip the downloaded file

    4. place the get_nightly.sh on your LE box somewhere, but NOT in ~/.update or /tmp

    5. to make the script executable run on linux (only once) :

    chmod u+x get_nightly.sh

    starting the script

    - ssh into the LE box

    - move to the folder where the script is stored

    - run the script via command:

    ./get_nightly.sh

    (for inexperienced linux users: it reads "./..."; (point slash ...)

    Be aware:

    - native tested is only Generic here (Generic-legacy and RPi* with dummy files only !)

    - script might contain "plain ol' men's thinkO's" and therefore Bugs

    - NO WARRANTY by me and use at you own risk.


    comments, bug reports, etc. are welcome.

    Coding-Hints

    - shell check analyse tool reports some minor (?) problems, I'm aware of...

    - piping the script through the tool "shfmt" and compare the original with the tool "meld" shows nearly the same, apart from the semicolon I use.

    - IIRC, I've learned it that way on Unix System V 30 years ago or might mix it with C programming.

    Anyway, to me it looks saner ending command lines with ";" -

    To remove the semicolons, you might use the following command line "cat <script-name> | shfmt > <output-name>"

    Changelog

    Version 0.10

    - today (24.07.2020) adjusted the server URL at line 44

    - initial release for the new (but tentatively) download server structure

    Edited 11 times, last by GDPR-7 (July 25, 2022 at 7:54 PM).

  • Excluding the change in the download server structure, may I ask if there are other changes between the old 0.10 and the new one?

    I downloaded it earlier this morning but I will test it tomorrow... because I had to test mine today :P

  • Excluding the change in the download server structure, may I ask if there are other changes between the old 0.10 and the new one?

    yes, there are changes esp. a fix for a bug I found.

    always use the newest script what is currently from 19.07.2020 !

    +++ EDIT +++

    ... from 24.07.2022 !


    ping CvH

    if you close/remove the elder thread could you remove the extension "(new version") from this thread ?

    or drop me a note I could do it ?

    Edited 2 times, last by GDPR-7: Merged a post created by JoeAverage into this post. (July 24, 2022 at 9:06 PM).

  • ping CvH

    it seems test3 is gone now (date: Sa 23. Jul 21:28:05 CEST 2022)

    is this correct ?


    if so:

    to the user using my script:

    +++ EDIT +++

    please remove the first comment sign "#" from line 45

    download the lastest script from date 24.07.2022

    Edited 4 times, last by GDPR-7 (July 27, 2022 at 12:31 AM).

  • I'd like everyone to stop "testing" and try watching some movies instead, or go play outdoors with the kids for a while instead of trying to act like uptime monitors for infrastructure that's being actively changed and fiddled with.

  • trying to act like uptime monitors for infrastructure that's being actively changed and fiddled with.

    please read (again) comment #7, first sentence, last half-sentence.

    so my "trying to act like uptime monitors for infrastructure" *might* prevent to fill up this thread with user complains, no one, at least me, needs

    deal ?

  • I assume the date was supposed to be 24.07.2022 and not 24.07.2020.

    It's clear to me, probably to most of you too, but to avoid confusing anyone unnecessarily, I wanted to soften it 👍.

  • Changing the server, which is removing a comment from somewhere or deleting a line completely so as to make it work, is a major update. Changing your name at the top of the script to add your info is a minor update.

    Things that impact the general usability of the script should be considered major updates.