From eb2f5f75f66ea1bb5852292d1548b15459f056ea Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 7 Aug 2007 15:19:33 +0000 Subject: fix netconsole status() --- rc.d/init.d/netconsole | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'rc.d') diff --git a/rc.d/init.d/netconsole b/rc.d/init.d/netconsole index ba99e2cb..136bfb5f 100644 --- a/rc.d/init.d/netconsole +++ b/rc.d/init.d/netconsole @@ -17,10 +17,6 @@ SERVER_ADDRESS_RESOLUTION= # Check that networking is up. . /etc/sysconfig/network -if [ ${NETWORKING} = "no" ] -then - exit 0 -fi # Source function library. . /etc/rc.d/init.d/functions @@ -35,11 +31,6 @@ SYSLOGMACADDR= kernel=`uname -r | cut -d. -f1-2` -[ -f /etc/sysconfig/netconsole ] || exit 0 -. /etc/sysconfig/netconsole - -[ -z "$SYSLOGADDR" ] && exit 0 - usage () { echo $"Usage: $0 {start|stop|status|restart|condrestart}" 1>&2 @@ -78,11 +69,16 @@ netconsole_failure () start () { + [ -f /etc/sysconfig/netconsole ] || exit 0 + . /etc/sysconfig/netconsole + SYSLOGOPTS= # syslogd server, if any + if [ -n "$SYSLOGADDR" ]; then if ! [[ "$SYSLOGADDR" =~ "^([0-9]{1,3}\.){3}[0-9]{1,3}$" ]]; then SYSLOGADDR=$(LANG=C host $SYSLOGADDR 2>/dev/null | awk '/has address / { print $NF }') fi + fi if [ -z "$SYSLOGADDR" ] ; then echo $"Server address not specified in /etc/sysconfig/netconsole" 1>&2 exit 1 @@ -118,8 +114,10 @@ status () { if /sbin/lsmod | grep netconsole >/dev/null 2>&1 ; then echo $"netconsole module loaded" + RETVAL=0 else echo $"netconsole module not loaded" + RETVAL=3 fi } -- cgit v1.2.1