#!/bin/sh
#
# ident "@(#)postpatch.src	1.4 06/03/07 SMI"
#
# Copyright 2004,2006 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#

# We may be installed as part of a jumpstart, so check
# the install root

UT_ROOTDIR=${2:-/}

VAR_UT_DIR=${UT_ROOTDIR}/var/opt/SUNWut/srds/dbm.ut
NEXTID_FILE=${VAR_UT_DIR}/NEXTID

if [ -f ${NEXTID_FILE} ]; then
	chmod 0600 ${NEXTID_FILE} 2> /dev/null
fi

UTCTL_RUN="${UT_ROOTDIR}/etc/opt/SUNWut/utctl.run"
if [ -f "$UTCTL_RUN" ]; then
	if [ "$UT_ROOTDIR" = "/" ]; then
		ALT_ROOT=""
	else
		ALT_ROOT="-n $UT_ROOTDIR"
	fi
	${UT_ROOTDIR}/opt/SUNWut/lib/utgenpam $ALT_ROOT disable
	${UT_ROOTDIR}/opt/SUNWut/lib/utgenpam $ALT_ROOT enable
fi
exit 0
