server/bin: clean up bash scripts

This is mostly adding set -e and quoting variables.
Merge pull request #29 from oremj/fixup-bash-scripts

server/bin: clean up bash scripts