-if expr match "$(readlink -f /proc/$$/fd/1)" '/dev/pts/[0-9]\+' > /dev/null && \
- expr match "$(readlink -f /proc/$$/fd/2)" '/dev/pts/[0-9]\+' > /dev/null; then
- CERROR="\e[1;31m" # red
- CWARNING="\e[1;33m" # yellow
- CMSG="\e[1;32m" # green
- CINFO="\e[1;96m" # light blue
- CDEBUG="\e[1;94m" # blue
- CNORMAL="\e[0;39m" # default system console color
- CDONE="\e[1;32m" # green
- CPASS="\e[1;32m" # green
- CFAIL="\e[1;31m" # red
- CCMD="\e[1;35m" # pink
+if [ "$MSGCOLOR" != 'NO' ]; then
+ if ! expr match "$(readlink -f /proc/$$/fd/1)" '/dev/pts/[0-9]\+' > /dev/null; then
+ export MSGCOLOR='NO'
+ fi
+fi
+
+
+if [ "$MSGCOLOR" != 'NO' ]; then
+ CERROR="\033[1;31m" # red
+ CWARNING="\033[1;33m" # yellow
+ CMSG="\033[1;32m" # green
+ CINFO="\033[1;96m" # light blue
+ CDEBUG="\033[1;94m" # blue
+ CNORMAL="\033[0;39m" # default system console color
+ CDONE="\033[1;32m" # green
+ CPASS="\033[1;32m" # green
+ CFAIL="\033[1;31m" # red
+ CCMD="\033[1;35m" # pink