clinton-hall/nzbToMedia — pull request #22 by SerhatG (2012-12-23 17:18:39+00:00)
Title: Fix substitution errors with non-bash shells, others sending might fail

The scripts has the hashbang for /bin/sh, I assume for portability
reasons. Some unix systems symlink sh to bash, others like Ubuntu (in my
case) symlink sh to dash or some other basic shell which do not support
the variable substitution. This is used for sending mail at this moment.

For portability reasons I check if we're in a bash shell, if so use the
bash variable substitution as this is available/faster than an external
command. If not as fallback sed will be used, which most of the cases is
present also. Even busybox has some basic sed available. This will
maximize portability usage of this script.