#!/bin/sh
#
# Post install script for IMNSearch cgi
#       1) Copy files from /usr/docsearch/cgi-bin
#       2) change ownership and permissions to imnadm:imnadm
#
#set -x
# Put in names of CGI to be deinstalled
cgi_name_1="db2srsen.exe"
cgi_name_2="db2srsbcs"
dummy()
{
return
}
system=`uname`
case "$system" in
        "AIX")  ECHO=echo
                ;;
        "HP-UX")ECHO=dummy
                ;;
        "SunOS")ECHO=dummy
                ;;
        *)      echo "Operating system not supported."
                exit 1
                ;;
esac
umask 022
# system commands with full path
sys_rm="/usr/bin/rm"
trg_cgi_dir="/var/docsearch/cgi-bin"
count=1

while [ ! -z "`eval echo \\$cgi_name_$count`" ]
do
  cgi_name="`eval echo \\$cgi_name_$count`"
  # copy cgi and change permission and ownwership
  $sys_rm -f $trg_cgi_dir/$cgi_name
  if [ $? -ne 0 ]
  then
    $ECHO "Error deleting file $trg_cgi_dir/$cgi_name !"
  fi
  count=`expr $count + 1`
done
exit 0
