Port to POSIX shell

So that it can be used on systems without bash / where bash is not used
for startup because of speed.
@singpolyma Aha! Thanks for explaining, that makes sense.