Use bash instead of sh

This script uses bash features but shebangs with sh,
this is problematic in debian-based systems where
sh is provided by dash and does not have such features.
Merge pull request #1 from defer/master

Use bash instead of sh