diederik, thanks for suggestions.
I've fixed the most mistakes I made via shellcheck, but not all.
the fixed version of the script is exchanged now in comment #1 to not blow up this thread.
* just a bad habit or in my fingers using rm with "-r".
I couldn't find something "potentially catastrophic";
I delete at three points in the script, always bundled with a true of the prev. command, e.g. cd ~/.update && rm -f *;
that should be fine, cause if nothing is to update there shouldn't be anything in ~/.update (left from me).
also I work in /tmp what is a) cleaned via reboot and b) I delete what I downloaded there
* script runs on LE here with #!/bin/bash
* 'mktemp'
there is a variant using tmpfile with a process number at the end in bash (in sh too ?)
currently can't remember hwo it extactly called ...
* functions
I usually do use them esp. when I need to run parts of the script more then once
All in all the script only should automate some tasks one normally need to do by hand:
- open the browser,
- go to the downlaod page,
- get last nightly link,
- ssh to the LE box
- cd to ~/.update,
- wget last nightly
- or the last three for samba users in one stroke: just place the nightly to the share: ~/.update/
- or further when update via AddOn works the script has lost it's or most of it benefit.
initial target was to keep elder nightly for a roll back; now they're available on the LE server, so what ?
last:
an hour ago I was thinking to extend the script with more hardware types and I discovered that I dynamically could read the info's I need from /etc/issue and kodi.log ... (me idiot )
but as of now it could update Generic and I hope others can do RPi* too (couldn't test; no HW here)