#!/bin/sh
#
# reconfig		This scripts runs the system reconfig program
#
# chkconfig: 345 06 95
# description: 	If /etc/reconfigSys exists, run the reconfiguration
#		program and remove /etc/reconfigSys when done.
#
#               Also will run if 'reconfig' is on the kernel cmdline.
#
# Source function library.
. /etc/rc.d/init.d/functions

RETVAL=$?

#
# this is required to avoid system logging intercepting input/output
# action on
#

case "$1" in
 start)
        if grep -i reconfig /proc/cmdline >/dev/null || [ -f /etc/reconfigSys ]; then
	    echo -n "Running system reconfiguration tool"
	    /usr/sbin/anaconda --reconfig
	    rm /etc/reconfigSys
	fi

	# We don't want to run this on random runlevel changes.
	touch /var/lock/subsys/reconfig

	;;
 stop)
 	rm -f /var/lock/subsys/reconfig
 	;;
 *)
 	echo "Usage: reconfig {start|stop}"
	exit 1
	;;
esac

exit $RETVAL
