In addition to #179 I stumbled through the code before checking for bug reports or pull requests (reworded my commit messages afterwards) and came up with a different solution than proposed in #194. Before fixing the issue itself I stumbled over different indentations, therefore added an editorconfig file and reindent with vim. Afterwards, I usually check shell scripts with https://github.com/koalaman/shellcheck and came up with some quick fixes which are also included in this pull request.
In addition to #179 I stumbled through the code before checking for bug reports or pull requests (reworded my commit messages afterwards) and came up with a different solution than proposed in #194. Before fixing the issue itself I stumbled over different indentations, therefore added an editorconfig file and reindent with vim. Afterwards, I usually check shell scripts with https://github.com/koalaman/shellcheck and came up with some quick fixes which are also included in this pull request.