diff options
Diffstat (limited to 'rc.d/init.d/functions')
-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 |