#!/bin/sh
#pragma ident	"@(#)preinstall	1.8	98/09/30 SMI"

#
# request_vers in this request script must track request_vers
# in the preinstall script.
#

request_vers=2

echo
echo

if [ "$REQUEST_VERS" != "$request_vers" ]
then
	gettext "Answers out of date. Need to re-run pkgask on this package."
	echo
	echo
	exit 1
fi

: ${KDC_CONF_REPLACE}
if [ ${KDC_CONF_REPLACE} -eq 1 ]
then
	: ${KDC_CONF_REALM:?}
	: ${KDC_CONF_TLIFE:?}
	: ${KDC_CONF_RLIFE:?}
fi

: ${KPROPD_ACL_REPLACE:?}
if [ ${KPROPD_ACL_REPLACE} -eq 1 ]
then
	: ${KPROPD_ACL_REPLACE:?}
	: ${KPROPD_ACL_REALM:?}
	: ${KPROPD_ACL_MASTER:?}
	: ${KPROPD_ACL_SLAVES:?}

fi

pname=SUNWkr5sl

from=${PKG_INSTALL_ROOT}/etc/krb5/kdc.conf
to=${from}-

if [ -f $from ]
then
	if [ $KDC_CONF_REPLACE -eq 1 ]
	then
	
		rm -f $to
		echo saving existing $from into $to
		mv $from $to
	fi 
fi

from=${PKG_INSTALL_ROOT}/etc/krb5/kpropd.acl
to=${from}-

if [ -f $from ]
then
	if [ $KPROPD_ACL_REPLACE -eq 1 ]
	then
		rm -f $to
		echo saving exising $from into $to
		mv $from $to
	fi
fi

exit 0
