aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d/netconsole
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2007-08-07 15:19:33 +0000
committerBill Nottingham <notting@redhat.com>2007-08-07 15:19:33 +0000
commiteb2f5f75f66ea1bb5852292d1548b15459f056ea (patch)
tree0b972f5130ead4f7ec205574290a3692f4dedc3d /rc.d/init.d/netconsole
parenta803968dcfba5ebcaa9b46dc763a0a7a7d92a0a3 (diff)
downloadinitscripts-eb2f5f75f66ea1bb5852292d1548b15459f056ea.tar
initscripts-eb2f5f75f66ea1bb5852292d1548b15459f056ea.tar.gz
initscripts-eb2f5f75f66ea1bb5852292d1548b15459f056ea.tar.bz2
initscripts-eb2f5f75f66ea1bb5852292d1548b15459f056ea.tar.xz
initscripts-eb2f5f75f66ea1bb5852292d1548b15459f056ea.zip
fix netconsole status()
Diffstat (limited to 'rc.d/init.d/netconsole')
-rw-r--r--rc.d/init.d/netconsole16
1 files changed, 7 insertions, 9 deletions
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
}