Use POSIX function definitions
Use POSIX test(1)
Use /bin/sh interpreter
Fix bashisms in contrib/ as well
Fix comparison
Merge pull request #9 from AMDmi3/kill-bashisms

Fix bashisms, make script runnable with POSIX shell (for example, on FreeBSD)