From d342d1f4a82d4b792e1069f2db74362e7cf1ae7a Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 7 Aug 2007 15:31:49 +0000 Subject: assorted cleanups --- rc.d/init.d/netconsole | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'rc.d/init.d/netconsole') diff --git a/rc.d/init.d/netconsole b/rc.d/init.d/netconsole index 136bfb5f..b25fed81 100644 --- a/rc.d/init.d/netconsole +++ b/rc.d/init.d/netconsole @@ -34,7 +34,7 @@ kernel=`uname -r | cut -d. -f1-2` usage () { echo $"Usage: $0 {start|stop|status|restart|condrestart}" 1>&2 - RETVAL=1 + RETVAL=3 } print_address_info () @@ -59,35 +59,27 @@ print_address_info () fi } -netconsole_failure () -{ - echo -n "$1" - failure - echo - exit 1 -} - start () { - [ -f /etc/sysconfig/netconsole ] || exit 0 + [ -f /etc/sysconfig/netconsole ] || exit 6 . /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 + 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 + exit 6 fi eval $(print_address_info $SYSLOGADDR) if [ -z "$SYSLOGMACADDR" ]; then echo $"netconsole: can't resolve MAC address of $SYSLOGADDR" 1>&2 - netconsole_failure "syslog server address resolution" + exit 1 fi SYSLOGOPTS="netconsole=$LOCALPORT@$LOCALADDR/$DEV,$SYSLOGPORT@$SYSLOGADDR/$SYSLOGMACADDR " -- cgit v1.2.1