#!/usr/bin/sh
#
# Script to configure the 6XX0 system to specific one
#
# pragma ident   "@(#)configure 1.8  03/11/20 SMI"
#
# Usage :
# o configure <system type>
#   System type : 6320, 6920
# 
AF=opt/SUNWsespsw/conf/admin_file

if [ $# -lt 1 -o $# -gt 2 ]; then
	echo "Usage: % configure <system type>/remove [Root_Base]"
	echo "         system_type: 6320, 6920"
	exit
fi
if [ $# -eq 2 ]; then
	BASE="$2"
else
	BASE="/"
fi

if [ "$1" = "6320" ];then
	chroot $BASE usr/sbin/pkgadd -a $AF -d export/packages SUNWse6320
	chroot $BASE sbin/final_security_check $BASE
else
	if [ "$1" = "6920" ]; then
		chroot $BASE usr/sbin/pkgadd -a $AF -d export/packages SUNWse6920
		chroot $BASE sbin/final_security_check $BASE
	else
		if [ "$1" = "remove" ]; then
			chroot $BASE usr/sbin/pkgrm SUNWse6920
			chroot $BASE usr/sbin/pkgrm SUNWse6320	
		else
			echo "Usage: % configure <system type>/remove [Root_Base]"
			echo "         system_type: 6320, 6920"
		fi
	fi
fi
