#!/bin/sh
#ident "Copyright (C) Compaq Computer Corporation. 1999 - 2001"
#ident "@(#)install.nsc.sh 1.2 99/11/04"
#
# This is the Compaq Management CD installation script. It is used
# to install all the Agents from the Compaq Management CD.

PATH=$PATH:/sbin
PKGINFO=/bin/pkginfo
PKGADD=/usr/sbin/pkgadd
GREP=/bin/grep

$PKGINFO nsc >/dev/null 2>&1
if [ $? -ne 0 ]; then
   echo "You are attempting to install NonStop Clusters UnixWare 7 agents on a non-clustered System"
   echo "Do you wish to install the non-clusted UnixWare 7 CIM agents (y/n) \c"
   read answer
   ANS=`echo $answer | $GREP -c -i y`
   if [ $ANS -eq 0 ]; then
        exit 1;
   fi;
   sh /mnt/agents/uware7/eng/compaq/install
   exit 0;
fi;

if [ -f ./nsc.pkg ]; then
	cp ./nsc.pkg /tmp/nsc.pkg
else
	cp /mnt/agents/nsc-uw7/eng/compaq/nsc.pkg /tmp/nsc.pkg
fi

VER="`$PKGINFO -l nscsnmp 2> /dev/null | $GREP VERSION | sed 's/.* //'`"
if [ "$VER" = "7.1.1" -o "$VER" = "7.1.1b" ]; then
	$PKGINFO nsc1013 > /dev/null 2>&1
	if [ $? != 0 ]; then
		$PKGADD -d /tmp/nsc.pkg nsc1013
	fi
fi

$PKGADD -d /tmp/nsc.pkg cmafdtn cmasvr cmastor cmanic
$PKGADD -d /tmp/nsc.pkg nsctools
rm -f /tmp/nsc.pkg
