aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xrc.d/init.d/functions25
1 files changed, 16 insertions, 9 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
index d6a6fdbb..20ae44b6 100755
--- a/rc.d/init.d/functions
+++ b/rc.d/init.d/functions
@@ -13,18 +13,25 @@
# First set up a default search path.
export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"
+# Get a sane screen width
+[ -z "$COLUMNS" ] && COLUMNS=80
+
# Read in our configuration
if [ -f /etc/sysconfig/init ]; then
. /etc/sysconfig/init
else
+ # This all seem confusing? Look in /etc/sysconfig/init,
+ # or in /usr/doc/initscripts-*/sysconfig.txt
BOOTUP=color
- COLOR_SUCCESS=2
- COLOR_FAILURE=1
RES_COL=60
+ MOVE_TO_COL="echo -en \"\\033[300C\\033[$[${COLUMNS}-${RES_COL}]D\""
+ SETCOLOR_SUCCESS="echo -en \"\\033[1;32m\""
+ SETCOLOR_FAILURE="echo -en \"\\033[1;31m\""
+ SETCOLOR_WARNING="echo -en \"\\033[1;33m\""
+ SETCOLOR_NORMAL="echo -en \"\\033[0;39m\""
LOGLEVEL=1
fi
-[ -z "$COLUMNS" ] && COLUMNS=80
if [ "$BOOTUP" != "verbose" ]; then
INITLOG_ARGS="-q"
@@ -177,21 +184,21 @@ status() {
}
echo_success() {
- [ "$BOOTUP" = "color" ] && echo -en "\\033[300C\\033[$[${COLUMNS}-${RES_COL}]D"
+ [ "$BOOTUP" = "color" ] && $MOVE_TO_COL
echo -n "[ "
- [ "$BOOTUP" = "color" ] && echo -en "\\033[1;3${COLOR_SUCCESS}m"
+ [ "$BOOTUP" = "color" ] && $SETCOLOR_SUCCESS
echo -n "OK"
- [ "$BOOTUP" = "color" ] && echo -en "\\033[0;39m"
+ [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL
echo -n " ]"
return 0
}
echo_failure() {
- [ "$BOOTUP" = "color" ] && echo -en "\\033[300C\\033[$[${COLUMNS}-${RES_COL}]D"
+ [ "$BOOTUP" = "color" ] && $MOVE_TO_COL
echo -n "["
- [ "$BOOTUP" = "color" ] && echo -en "\\033[1;3${COLOR_FAILURE}m"
+ [ "$BOOTUP" = "color" ] && $SETCOLOR_FAILURE
echo -n "FAILED"
- [ "$BOOTUP" = "color" ] && echo -en "\\033[0;39m"
+ [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL
echo -n "]"
return 1
}