/etc/grml/lsb-functions: another bugfix
[grml-etc-core.git] / etc / grml / lsb-functions
index 11ddbcf..07abdd3 100644 (file)
@@ -100,7 +100,7 @@ log_end_msg() {
     if _have_tput ; then
         COLS="$("$TPUT" cols)"
         if [ -n "$COLS" ]; then
-            COL=$(( "$COLS" - 7 ))
+            COL=$(( $COLS - 7 ))
         else
             COL=73
         fi
@@ -143,6 +143,7 @@ RC_DOT_PATTERN=''
 if [ -r /proc/cmdline ] ; then
     grep -q ' nocolor' /proc/cmdline && RC_NOCOLOR='yes'
 fi
+[ -n "$NOCOLORS" ] && RC_NOCOLOR='yes'
 RC_NOCOLOR="${RC_NOCOLOR:-no}"
 
 # Can the terminal handle endcols?
@@ -156,7 +157,7 @@ if [ -z "${COLS}" ] || [ "${COLS}" -le 0 ] ; then
 fi
 
 if [ "${RC_ENDCOL}" = "yes" ]; then
-    ENDCOL="\e[A\e[$(( "${COLS}" - 8 ))G"
+    ENDCOL="\e[A\e[$(( ${COLS} - 8 ))G"
 else
     ENDCOL=''
 fi
@@ -201,7 +202,7 @@ esyslog() {
 eindent() {
     local i="$1"
     [ "$i" -gt 0 ] || i="${RC_DEFAULT_INDENT}"
-    esetdent $(( ${#RC_INDENTATION} + "$i" ))
+    esetdent $(( ${#RC_INDENTATION} + $i ))
 }
 
 # void eoutdent(int num)
@@ -211,7 +212,7 @@ eindent() {
 eoutdent() {
     local i="$1"
     [ "$i" -gt 0 ] || i="${RC_DEFAULT_INDENT}"
-    esetdent $(( ${#RC_INDENTATION} - "$i" ))
+    esetdent $(( ${#RC_INDENTATION} - $i ))
 }
 
 # void esetdent(int num)
@@ -295,7 +296,7 @@ ebegin() {
     [ "${RC_QUIET_STDOUT}" = "yes" ] && return 0
 
     if [ -n "${RC_DOT_PATTERN}" ]; then
-        dots="$(printf "%$(( "$COLS" - 3 - ${#RC_INDENTATION} - ${#msg} - 7 ))s" '')"
+        dots="$(printf "%$(( $COLS - 3 - ${#RC_INDENTATION} - ${#msg} - 7 ))s" '')"
         while [ "${dots#${spaces}}" != "${dots}" ] ; do
             dots="${dots#${spaces}}${RC_DOT_PATTERN}"
         done
@@ -337,7 +338,7 @@ _eend() {
         printf "${ENDCOL}  ${msg}\n"
     else
         [ "${LAST_E_CMD}" = "ebegin" ] || LAST_E_LEN=0
-        printf "%$(( "${COLS}" - "${LAST_E_LEN}" - 6 ))s%b\n" '' "${msg}"
+        printf "%$(( ${COLS} - ${LAST_E_LEN} - 6 ))s%b\n" '' "${msg}"
     fi
 
     return "${retval}"