Some of the scripts uses the function key word which is a feature in bash and not supported in shell.
Running the agent.sh for example gives bin/agent.sh: 24: function: not found
The script headers should be changes to !/bin/bash and then it works.
I propose this be done for all of the sh scripts for consistency.
I'll attach a patch today.