Changed interpreter from bash /bin/sh

For a script that targets a large variety of unices, the presence of
bash should not be expected. Also, the bash executable may not reside in
/bin, e.g. on FreeBSD this is /usr/local/bin.
Better curl support

Script now checks whether curl or wget is present and will use whatever
it finds.

Also fixed a typo by replacing $user-agent with ${user_agent}
Messed up indent, fixed before sending pull request
Merge pull request #2 from dajero/master

Made bash script more portable