#! /bin/sh # # $Id: nmc_checkinstall.SunOS,v 1.2.6.1 2007/01/22 20:11:04 tompkb1 Exp $ Copyright (c) 2002-2006 EMC Corporation. # # # Copyright (c) 2002-2006 EMC Corporation. # # All rights reserved. This is an UNPUBLISHED work, and # comprises proprietary and confidential information of EMC. # Unauthorized use, disclosure, and distribution are strictly # prohibited. Use, duplication, or disclosure of the software # and documentation by the U.S. Government is subject to # restrictions set forth in a license agreement between the # Government and EMC or other written agreement specifying # the Government's rights to use the software and any applicable # FAR provisions, such as FAR 52.227-19. # # # Function: # setecho # # Description: # Defines the echo_n() function with proper echo semantics. # # Arguments: # # Parameter Purpose # ---------------------- -------------------------------------------- # # Returns: # # Return Variable Purpose # ---------------------- -------------------------------------------- # # Notes: # setecho() { umask 22 if [ -f /usr/ucb/echo ]; then echo_n() { echo -n "$*" } else echo_n() { echo "$* \c" } fi } # NOTE: some systems put "Berkeley" utilities in /usr/ucb, others (e.g. SGI) # put them in /usr/bsd. Also, some systems use /usr/etc and other use # /usr/sbin. We include all variants in addition to the path to this # program to be safe. mypath="`expr X\"${1}\" : X'\(.*\)/.*' \| X\"${1}\" : X'\(/\)[^/]*$' \| 'X'`" PATH=/usr/ucb:/usr/bsd:/bin:/usr/bin:/etc:/usr/etc:/usr/sbin:$mypath:$PATH export PATH if [ "$PKGINST" = "LGTOnmc" ]; then BRAND="NetWorker Management Console" BASEBRAND="NetWorker" BASEPKGNAME=LGTOclnt BASEREQVER=740 BASEREQVERSTR=7.4.0 else BRAND="Sun StorageTek EBS Management Console" BASEBRAND="Sun StorageTek EBS" BASEPKGNAME=SUNWebsc BASEREQVER=740 BASEREQVERSTR=7.4.0 fi setecho # Make sure OS is atleast 5.8 OS_REL=`uname -r` OS_REL_COMP=`echo $OS_REL |sed 's?\.??'` if [ "$OS_REL_COMP" -lt "58" ]; then echo "ERROR: The current OS version is $OS_REL. The minimum required" echo " OS version is 5.8 with the latest Sun recommended patch" echo " cluster." exit 1 fi # Make sure the old packages are deleted pkginfo -q LGTObgst if [ $? -eq 0 ]; then echo echo "ERROR: The LGTObgst package must be uninstalled before installing" echo " this package." echo exit 1 fi if [ -f /tmp/noclicheck ]; then # Hook to disable client version check when testing in non production environment NWCLIVER=$BASEREQVER else # Make sure the client is of the required version NWCLIVER=`pkginfo -l $BASEPKGNAME | awk ' /VERSION/ { print $2 }' | sed 's/[Bb]uild.*$//g' | sed 's/REV.*$//g' | sed 's/[^0-9]//g'` NWCLIVER=`echo "$NWCLIVER"000` NWCLIVER=`echo $NWCLIVER | cut -c1-3` fi # For dev tree version client we will have NWCLIVER as 0. # So keep that hook. if [ $NWCLIVER -lt $BASEREQVER -a $NWCLIVER -ne 000 ]; then echo echo "ERROR: $BASEBRAND client version $BASEREQVERSTR or higher needs to be" echo " installed before installing this package." echo exit 1 fi exit 0