diff options
author | Bill Nottingham <notting@redhat.com> | 2002-03-13 03:07:07 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2002-03-13 03:07:07 +0000 |
commit | d090c112c1a20baf198a1f1a6ab14cd804ad755c (patch) | |
tree | 0c50ca589efbb3947bf37c7db42d1ce31be2eefa | |
parent | a3c8e9c92b8a97f32dca7084db9591e2cd432f58 (diff) | |
download | initscripts-d090c112c1a20baf198a1f1a6ab14cd804ad755c.tar initscripts-d090c112c1a20baf198a1f1a6ab14cd804ad755c.tar.gz initscripts-d090c112c1a20baf198a1f1a6ab14cd804ad755c.tar.bz2 initscripts-d090c112c1a20baf198a1f1a6ab14cd804ad755c.tar.xz initscripts-d090c112c1a20baf198a1f1a6ab14cd804ad755c.zip |
add warning message target. For LSB stuff
-rwxr-xr-x | rc.d/init.d/functions | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index c888e022..44446c42 100755 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -330,6 +330,17 @@ echo_passed() { return 1 } +echo_warning() { + [ "$BOOTUP" = "color" ] && $MOVE_TO_COL + echo -n "[" + [ "$BOOTUP" = "color" ] && $SETCOLOR_WARNING + echo -n $"WARNING" + [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL + echo -n "]" + echo -ne "\r" + return 1 +} + # Log that something succeeded success() { if [ -z "${IN_INITLOG:-}" ]; then @@ -372,6 +383,20 @@ passed() { return $rc } +# Log a warning +warning() { + rc=$? + if [ -z "${IN_INITLOG:-}" ]; then + initlog $INITLOG_ARGS -n $0 -s "$1" -e 1 + else + trap "" SIGPIPE + echo "$INITLOG_ARGS -n $0 -s \"$1\" -e 1" >&21 + trap - SIGPIPE + fi + [ "$BOOTUP" != "verbose" ] && echo_warning + return $rc +} + # Run some action. Log its output. action() { STRING=$1 |