Fix bashrc configuration

Added missing `fi` to `if` clause and added check for `termdetect` command.