#!/sbin/sh
####################################
#  Product: OpenSSL
#  Fileset: Latest
#  preinstall
#  (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
####################################
# Setup config files
####################################

DEFAULT_VERSION="0.9.8"


bin_dirs_list="/opt/openssl/fips/0.9.8/bin"
DUAL_VERSION=0

for bin_dir in $bin_dirs_list
do
  if [[ -d $bin_dir ]]
  then
    DUAL_VERSION=1
    for list in `ls $bin_dir`
    do
      rm -f ${bin_dir}/{$list} 1>/dev/null 2>/dev/null
      if [ $? -ne 0 ]
      then
        mv ${bin_dir}/{$list} ${bin_dir}/#{$list} 1>/dev/null 2>/dev/null
        echo "${bin_dir}/\#${list}" >> /var/adm/sw/cleanupfile
      fi
    done
  fi
done


####################################
exit $exitval
####################################

