Use shellcheck to rework the code. Use "export" to return variables from a function call. Further, fix typos. Signed-off-by: Nick Hainke <vincent@systemli.org>