#!/bin/sh
#
#	Copyright (c) 2002, 2003 The SCO Group, Inc..
#	All Rights Reserved.
#
##############################################################################

CMPNTCHECK=Apache
CMPNTNAME=modssl
CMPNTDESC="mod_ssl for Apache"

# source in std. library functions:
[ -f /ibin/ccsSetup.sh ] && . /ibin/ccsSetup.sh

[ -f /tmp/debug_$CMPNTCHECK ] && set -x

[ -f /tmp/$CMPNTCHECK.nocheck ] && exit $OK

need646=1
failureval=$FAIL

osver=`/bin/uname -X | /bin/grep '^Release' | /bin/sed -e 's/Release = 3.2v//'`
case $osver in
  5\.0\.4 | 5\.0\.5 | 5\.0\.6)
    # Do nothing right now
    ;;
  *) ccsLog "Unsupported OS version $osver"
     ${SSO_SHARED_ROOT}/cntl/badver $osver "$CMPNTDESC"
     exit $STOP
     ;;
esac

UNIXPATCHES=`customquery ListPatches SCO:Unix 2> /dev/null`

echo " $UNIXPATCHES " | grep 'OSS646[B-Z]' > /dev/null 2>&1
if [ $? -eq 0 ]; then
  need646=0
else
  OLDVERSION=`customquery ListComponents SCO:$CMPNTNAME 2> /dev/null`
  if [ -n "$OLDVERSION" ]; then
    HASOLDVERSION=1
  else
    HASOLDVERSION=0
  fi
  if [ "x$HASOLDVERSION" = "x0" ]; then
    failureval=$STOP
  fi
fi

if [ "x$need646" = "x1" ]; then
  ${SSO_SHARED_ROOT}/cntl/need646 "$CMPNTDESC"
  exit $failureval
fi

exit $OK

