If the install errors out on semanage not found, a file not found is
thrown as a 'file not found' for error. Updating to 'fatal' resolves
this as the script then exits as intended and throws an 'error'.
Where no variable expansion is done, " is replaced with '.
Copying content of one variable to another variable never needs quotes.
Some calls to echo and fatal need no quotes at all, but have been left
with ' to make it easier to see where the string begins and ends.
The fatal function now also sends output to stderr.
Change-Id: I2504707e5c550bc498e7663cedf58c224cd0a15b
Signed-off-by: Joakim Roubert <joakimr@axis.com>
Reportedly, some systems don't have curl but wget. With this patch,
install.sh will use wget instead of curl if the latter is not available
on the target system.
Change-Id: I0bc78feec6d8e1dbf7fbef7c2e10833b79bdbbdc
Signed-off-by: Joakim Roubert <joakimr@axis.com>
For integer comparison, it is recommended to use '-eq' instead of the
broader comparison '='. From the manual:
n1 -eq n2 True if the integers n1 and n2 are algebraically equal.
s1 = s2 True if the strings s1 and s2 are identical.
Change-Id: I3a92c3944a19e7a618438a9e3e304d9de5d9874f
Signed-off-by: Joakim Roubert <joakimr@axis.com>
The install.sh script currently uses a mix of the legacy backquote
syntax and the recommended contemporary $() syntax. This patch brings
consistency by replacing the occurrences of the legacy backquote ones
with the $() syntax.
Change-Id: I018f3250175064dcb22ef86a0240b2c804153641
Signed-off-by: Joakim Roubert <joakimr@axis.com>
If install.sh relies on awk, install.sh malfunctions when run on a
device with a limited environment where awk is not available. This patch
replaces the use of awk with built-in shell script functionality.
Change-Id: I071d9f565ff7ef38445a6dd0ea9692b903721601
Signed-off-by: Joakim Roubert <joakimr@axis.com>
Cert generation may cause slow startup times for some systems such as
the Raspberry Pi, set the systemd service TimeoutStartSec to Infinity to
avoid startup timeouts.
Check for latest release of k3s or pass a desired version as an
argument. Adds curl as a requirement and early exits if not available.
Fixes silent abort when wget is not available and `which` returns
non-zero exit code.