DOMjudge / domjudge-packaging

DOMjudge packaging for (Linux) distributions and live image
32 stars 40 forks source link

Silence spurious shellcheck error SC2153 "Possible Misspelling" in Docker startup script #138

Closed tom93 closed 2 years ago

tom93 commented 2 years ago

Error message:

Notice: ./docker/domserver/scripts/start.d/50-domjudge.sh:25:13: note: Possible misspelling: MYSQL_HOST may not be assigned. Did you mean MYSQL_PORT? [SC2153]

The environment variable MYSQL_HOST is in fact set in the Dockerfile, but ShellCheck doesn't know that.

Abort if the variable is unset (using the parameter expansion ${VAR:?message}), to teach ShellCheck that this variable exists and to give a clear error message if somehow the variable is unset.

Also check some other variables for consistency.