Commit Graph

9 Commits

Author SHA1 Message Date
Miroslav Šedivý 81013dc36d update neko images. 2021-07-29 21:57:10 +02:00
Aaron a3cc707399 install: Convert NEKO_IMAGES variable to array
Signed-off-by: Aaron <admin@datahoarder.dev>
2021-06-13 10:43:42 +02:00
Aaron e36570df14 install: Code refactoring
Formats the `install` script in accordance with Google's Shell Style Guide using `shfmt` and applies fixes for issues that were found by the static analysis tool `shellcheck`.

Style changes
- Consistent two space indentation.
- Consistent formatting of `for ... do` loops and `if ... then` code blocks.
- Consistent brace-delimiting of variable names.
- Consistent upper-case spelling of variable names.
- Consistent alphabetic ordering of packages installed/removed by `apt-get`.
- Explicit error codes for `exit` commands.
- All error messages sent to `STDERR`.
- Use of `[[ -z "${VAR}" ]]` instead of `[[ "${VAR}" == "" ]]`.

Shellcheck fixes
- Double quote variables to prevent globbing and word splitting. [SC2086]
- Use `{ cmd1; cmd2; } >> file` instead of individual redirects. [SC2129]
- Useless `echo`. Instead of `echo $(cmd)`, just use `cmd`. [SC2005]
- To redirect stdout+stderr, `2>&1` must be last. [SC2069]
- `read` without `-r` will mangle backslashes. [SC2162]

The variable `NEKO_IMAGES` is purposefully left unquoted in the `for ... do` loop on L245 since it is an array where we do want word splitting to happen.

Signed-off-by: Aaron <admin@datahoarder.dev>
2021-06-13 10:27:31 +02:00
Aaron b9485d8586 install: Simplify echo sequence
The shell built-in "echo" preserves newlines by default, so there is no need to issue a new echo command for every new line in a formatted text. This version is not only faster, but easier and less error prone to edit as well.

Signed-off-by: Aaron <admin@datahoarder.dev>
2021-06-09 14:25:46 +02:00
Miroslav Šedivý 2d8e009376 add custom neko images in install script. 2021-06-08 10:34:00 +02:00
Miroslav Šedivý 28ea3e678a remove unnecessary exit from install. 2021-05-31 21:00:42 +02:00
Miroslav Šedivý 8cf90ad8a5 traefik typo in example email. 2021-05-31 20:59:44 +02:00
Miroslav Šedivý 923f17cb26 update install script. 2021-05-31 20:58:54 +02:00
Miroslav Šedivý e21cbb29ae Install script #7. 2021-05-22 23:28:56 +02:00