
#!/bin/ksh
#script to determine if machine is supported
# Gabriele Rearick,  gabriele_rearick@hp.com

ARCHITECTURE="unknown"
OS=`uname`
if [ $OS = HP-UX ] ; then

CPU_VERSION=$(/usr/bin/getconf CPU_VERSION 2>/dev/null)

# numbers from /usr/include/sys/unistd.h
case $CPU_VERSION in
    523)
        print PA-RISC1.0
        echo "This CPU type is not supported"
        exit
        ;;
    528)
        print PA-RISC1.1
        echo "This CPU type is not supported"
        exit
        ;;
    529)
        print PA-RISC1.2
        echo "This CPU type is not supported"
        exit
        ;;
    532)
        print PA-RISC2.0
      echo "Good. Your cpu type is supported. It is of type:" ; echo $cpu_type
      echo "Checking now the OS version:"
        ;;
    768)
        print IA-64
      echo " Your architecture is IA64.  You have either an Itanium CPU or a McKinley CPU"
      echo "Checking now the OS version:"
        ;;
     *)
        print Unknown
        exit
        ;;
esac

   OSVERSION=`uname -r`
   if [ $OSVERSION = B.11.22 ] || [ $OSVERSION = B.11.20 ] ; then
       echo "Your OS version is:" ; echo $OSVERSION
       echo " You are running on IA64.  Choose the IA64 version of rasmol "

   elif  [ $OSVERSION = B.11.00 ] || [ $OSVERSION = B.11.11 ] ; then
       echo "Your OS version is:" ; echo $OSVERSION
       echo " You are running on PARISC. Choose the PARISC verion of rasmol "

   elif  [ $OSVERSION = B.11.23 ] ; then
       echo "Your OS version is:" ; echo $OSVERSION
       echo "  That's not available yet"

   else 
       echo "Any OS version older than HPUX11.x (10.x, 9.x) is not supported. Sorry!"
       echo "BTW, the support life of HPUX10.20 ends in mid 2003!"
   fi
else
   echo " Your OS is:"
   echo $OS
   echo " I don't know if an executable is available for this OS "
fi
