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


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 is not clear the OS version of the system. If this is part of a"
      echo "jumpstart installation, please ignore this message. If you desire"
      echo "to abort this patch installation, type ^C (control-c)."

      sleep 10
      echo
      exit 0   
   fi
fi

echo

case $rel in

   5.6|2.6|5.7|2.7|7) echo
	echo " This patch only applies to Solaris 8. For Solaris 2.6 or"
	echo " Solaris 7 please apply patch 112327. Patch terminating..."
	echo
	exit 1
	;;

   5.8|2.8|8) echo
	# exit cleanly
	exit 0 
	;; 

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

exit 0
