use '==' instead of '-eq' for string comparison
added note that script must be sourced
use $BASH_SOURCE env var instead of $0

$0 will contain sh/bash when using source to run the script. BASH_SOURCE
contains the name of the file even when source is used.

Note: only works on bash, not standard Bourne shell.