#!/bin/sh
#
# Run sysreport
#
# chkconfig: 2345 98 02
# description: This service gathers system information via system-report.

WITHOUT_RC_COMPAT=1

# Source function library.
. /etc/init.d/functions

LOCKFILE=/var/lock/subsys/sysreport

case "$1" in
	start|restart|reload)
		# This action line is required to fool rc script.
		system-report -o "/root/sysreport-$(date +"%Y%m%d").tar.bz2"
		touch "$LOCKFILE"
		;;
	stop|condstop)
		rm -f "$LOCKFILE"
		;;
	*)
		;;
esac

exit 0
