#! /bin/sh
#
# Copyright (c) 2004 SUSE Linux AG, Nuernberg, Germany.
# All rights reserved.
#
# /etc/init.d/lkcd-netdump
#
### BEGIN INIT INFO
# Provides:          lkcd-netdump
# Required-Start:    $network
# X-UnitedLinux-Should-Start:
# Required-Stop:
# Default-Start:     2 3 5
# Default-Stop:
# Description:       Activate the Linux Kernel Crash Dump Facility.
### END INIT INFO

. /etc/rc.status
. /etc/sysconfig/dump

if [ "$DUMP_ACTIVE" != "1" ]; then
	exit 6
fi

# Check for netdump; exit if not configured
if (($DUMP_FLAGS > 0x60000000)); then
	exit 6
fi

rc_reset

case "$1" in
  start)
	#
	# We don't need to check for existing dumps, they are
	# stored somewhere else.
	# Just configure lkcd and be done with.
	#
	echo -n "Configuring LKCD for network dump "
	lkcd config
	rc_status -v
	;;
    stop)
	# skip / do nothing
	;;
    status)
	rc_failed 4
	rc_status -v
	;;
    *)
	echo "Usage: $0 {start|stop|status}"
	exit 1
	;;
esac

rc_exit

