aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>1999-02-25 17:11:32 +0000
committerBill Nottingham <notting@redhat.com>1999-02-25 17:11:32 +0000
commit8f3de3c2215ad165c80bedaa99e408193cf91606 (patch)
tree5302a3c8953126b6b5a58884b32770ac61e9eba1 /rc.d
parentbf72ce488a9d43c9752f926e4bc3f55f8d67a141 (diff)
downloadinitscripts-8f3de3c2215ad165c80bedaa99e408193cf91606.tar
initscripts-8f3de3c2215ad165c80bedaa99e408193cf91606.tar.gz
initscripts-8f3de3c2215ad165c80bedaa99e408193cf91606.tar.bz2
initscripts-8f3de3c2215ad165c80bedaa99e408193cf91606.tar.xz
initscripts-8f3de3c2215ad165c80bedaa99e408193cf91606.zip
ditto
Diffstat (limited to 'rc.d')
-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
}