colorize/colpanic(): reset attributes after giving out the message
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Fri, 28 Oct 2005 17:59:37 +0000 (17:59 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Fri, 28 Oct 2005 17:59:37 +0000 (17:59 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2197 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/scripts/functions

index 4b8e4c8..4a24bd5 100644 (file)
@@ -203,14 +203,21 @@ function colorize
          esac
        fi
            
-       "$@"
+       ( "$@" )
        echo -ne "\e[m"
     fi
 }
 
 function colpanic
 {
-    colorize error   panic     "$@"
+    if test -n "$_VS_ERRFILE"; then
+       echo "$@" >>"$_VS_ERRFILE"
+    else
+       colorize echo -n "$@" >&2
+    fi
+    echo
+
+    exit 1
 }
 
 function colwarning