Changed shebang to #!/bin/bash. 

When invoked as sh (POSIX mode), the -n option for echo is not supported. This should fix the "Could not authenticate you" error on OS X.