This commit fixes lint warnings produced by shellcheck. This simplifies some of the `if`s and protects against variables with spaces. We may want to consider shellchecking all scripts in the repo. Signed-off-by: Lucas Servén Marín <lserven@gmail.com>