#! /sbin/sh
########
# Product: Ignite-UX
# Fileset: OBAM-RUN
# configure
# @(#) $Revision: 10.5 $
########
#
# (c) Copyright Hewlett-Packard Company 1996
#
########################################################################

##########################################################################
#
# Automatically configure IUX to use /opt/ignite/obam.10 on
# HP-UX systems that are not 10.0/10.01/10.10/10.20/11.00.  Do this
# by making a symlink to /opt/ignite/obam.
#
# On 11.10 systems and forward /usr/obam is sufficient
#
# We use to just exclude the fileset from system that did not need
# it, but that does not allow an 11.10 system to be a recovery server
# for 10.X/11.00 clients that pull IUX from the server's packaged-in-place
# depot.
#

UTILS=/usr/lbin/sw/control_utils
if [ -f $UTILS ]
then
    . $UTILS
else
    echo "ERROR:   Cannot find $UTILS"
    exit 1
fi

# Always remove the old version of obam (or the symlink).
# Also if we failed the remove in the past, try obam.ok_to_rm as well.
rm -rf /opt/ignite/obam /opt/ignite/obam.ok_to_rm > /dev/null 2>&1
if [ -d /opt/ignite/obam ] ; then
    mv /opt/ignite/obam /opt/ignite/obam.ok_to_rm
        echo "\
NOTE:    Could not remove the directory: \"/opt/ignite/obam.ok_to_rm\", it
         may have busy files in it.  You may remove it manually later."
fi

case $(uname -r) in
*.10.00|*.10.01|*.10.10|*.10.20|*.11.00)
    # A new obam is needed on these releases
    ln -s obam.10 /opt/ignite/obam
    ;;
esac
exit $SUCCESS
