#!/sbin/sh
########################################
#  Product: OpenSSL
#  Fileset: Latest
#  checkinstall
#  (c) Copyright Hewlett-Packard Company
########################################
UTILS="/usr/lbin/sw/control_utils"
    if [[ ! -f $UTILS ]]
    then
        echo "ERROR: Cannot find $UTILS"
        exit 1
    fi
    . $UTILS
exitval=$SUCCESS
####################################
#  Check if we are real root.  The guidelines say we will always be
#  real root during install, but don't mention anything about SWCONFIG.
#  We'll check just to be on the safe side.
####################################
if [[ $SW_ROOT_DIRECTORY != "/" ]]
then
        echo "ERROR:   OpenSSL can NOT be configured from an alternate"
        echo "         root environment!"
        exit 1
fi
####################################
#kill_named_procs prngd KILL 1>/dev/null 2>/dev/null

#if [ ! -d /opt/openssl ]; then
#    mkdir /opt/openssl  > /dev/null 2>&1
#    chmod 555 /opt/openssl >/dev/null 2>&1
#    chown bin:bin /opt/openssl >/dev/null 2>&1
#fi

#cd /opt/openssl

#rm -rf old >/dev/null 2>&1

#if [ ! -a /opt/openssl/old ]; then
#  mkdir old > /dev/null 2>&1
#  chmod 555 old > /dev/null 2>&1
#  chown bin:bin old > /dev/null 2>&1
#fi

#for dirs in `ls`; do
#  if [ ${dirs} = "old" -o ${dirs} = "fips" -o ${dirs} = "newconfig" -o ${dirs} = "certs" -o ${dirs} = "private"  ]; then
#     continue
#  fi
#  if [ ${dirs} = "openssl.cnf" -a ! -L ${dirs} ]; then
#     continue
#  fi
#  rm -rf ${dirs} > /dev/null 2>&1
#  if [ -a /opt/openssl/${dirs} ]; then
#     mv ${dirs} old/${dirs}_$$ >/dev/null 2>&1
#  fi
#done

#rm -rf old >/dev/null 2>&1

#cd - >/dev/null 2>&1
####################################
exit $exitval
####################################
