Use OSTYPE=linux* wildcard instead.

Some distros like openSUSE set OSTYPE to "linux" whereas Ubuntu seems to
use "linux-gnu".
Check for presence of brew.

On non-mac systems, and those which do not have /etc/bash_completion,
the elif would fail since brew does not exist.

Check for existence of brew before invoking it.