#!/sbin/sh
# $Id: athena.config,v 1.1.1.1 1998/12/30 18:34:22 danw Exp $
#
# Make sure the state of the system is synchronized with /etc/athena/rc.conf.
#

case "$1" in
start|stop)
	. /etc/athena/rc.conf

	# Solaris rc scripts get run with umask 0.
	umask 022

	status=0
	case "$PUBLIC" in
	true)
		/etc/athena/syncconf -q -a
		status=$?
		;;
	false)
		case "$SYNCCONFIG" in
		true)
			/etc/athena/syncconf -q
			status=$?
			;;
		esac
	esac

	# syncconf exits with status 1 if rc2 is modified.  Reboot if this
	# happened and we're running syncconf on startup.
	if [ "$1" = start -a "$status" -eq 1 ]; then
		echo "Need to reboot for configuration changes..."
		sync
		sleep 15
		exec reboot
	fi
        ;;

*)
        echo "usage: athena.config {start|stop}"
        ;;
esac

