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

# We may be backing out on an alternate root partition, so check
# the install root

UT_ROOTDIR=${2:-/}

# If pam.conf contains Sun Ray changes, restore the pam.conf file
# using the old utgenpam.  The postbackout script should've cleaned
# up the pam.conf file using the patched version of utgenpam.
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 enable
fi
exit 0
