#!/bin/sh
#
# Copyright (c) 2002 by Sun Microsystems, Inc.
# All rights reserved
#
# "@(#)prepatch 1.1     02/02/03 SMI"
#
# This script checks for the correct Solaris Release before installing.
#
# Prepatch script for patch 1110262, Solaris 7


PATH=/usr/bin
export PATH

if [ "$ROOTDIR" = "/" ]; then
   rel=`uname -r`
elif [ -n "$PATCH_CLIENT_VERSION" ]; then
   rel=$PATCH_CLIENT_VERSION
else
   release_file=$ROOTDIR/var/sadm/system/admin/INST_RELEASE
   if [ -f "$release_file" ]; then
      rel=`grep VERSION $release_file | nawk -F= '{print $2}'`
   else
      echo "It's not clear the OS version of the system. Patch Terminating.."
      echo
      exit 1   
   fi
fi

echo

case $rel in

  5.5.1|2.5.1) echo
	echo "This patch only applies to Solaris 7. For Solaris 2.5.1, please apply patch"
	echo "110260. Patch terminating.."
	echo
	exit 1
	;;

   5.6|2.6) echo
	echo "This patch only applies to Solaris 7. For Solaris 2.6, please apply patch"
	echo "110261. Patch terminating.."
	echo
	exit 1
	;;

   5.7|2.7|7) echo
	# exit cleanly
	exit 0 
	;; 

   5.8|8) echo
	echo "This patch only applies to Solaris 7. For Solaris 8, please apply patch"
	echo "110263. Patch terminating.."
	echo
	exit 1
	;;

   *)	echo
        echo " This OS version is not supported by this patch"
        echo " Patch terminating.."
	echo
	exit 1
	;;
esac

exit 0
