#! /bin/ksh
#
# Licensed Materials - Property of IBM
#
#  5724-A60
#  5765-F36
#  (C) Copyright IBM Corporation 2001, 2004
#
# All Rights Reserved.
#
# US Government Users Restricted Rights - Use, duplication or
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
#
# This script removes the symbolic link(s) created by idm_liblink.
# The script must be executed as root !
#

# The library needed by IM Scoring
ORALIB=libclntsh

######################################################

# First we must find out the operating system
case "$(uname -s)" in
*AIX*)   LIBEXT=a
         LIBVERSION=
         LIBDIR=/usr/opt/IMinerX/V8.2/lib
         IDCOM=id ;;
*SunOS*) LIBEXT=so
         LIBVERSION=8.0
         LIBDIR=/opt/IMinerX/V8.2/lib
         IDCOM=/usr/xpg4/bin/id ;;
*Linux*) LIBEXT=so
         LIBVERSION=8.0
         LIBDIR=/opt/IMinerX/V8.2/lib
         IDCOM=id ;;
    *) echo Error: Operating system found: $(uname -s). Supported are: AIX, SunOS, Linux
       exit ;;
esac

ORALIB=$ORALIB.$LIBEXT

if [ $($IDCOM -u) != 0 ]; then
 echo "This script must be executed as root."
 exit 1
fi

if [ -f $LIBDIR/$ORALIB ]; then
  rm $LIBDIR/$ORALIB
fi
if [ -f $LIBDIR/$ORALIB.$LIBVERSION ]; then
  rm $LIBDIR/$ORALIB.$LIBVERSION
fi

echo "Link(s) to Oracle library successfully removed."



