#! /sbin/sh
########
# Product: Ignite-UX
# Fileset: MGMT-TOOLS
# preinstall
# @(#) $Revision: 10.3 $
########
#
# (c) Copyright Hewlett-Packard Company 1999
#
########################################################################

##########################################################################
# Prepare to Copy the manifest template file into place if it doesn't
# exist
#
UTILS=/usr/lbin/sw/control_utils
if [ -f $UTILS ]
then
    . $UTILS
else
    echo "ERROR:   Cannot find $UTILS"
    exit 1
fi

INST_DIR=/opt/ignite
VAR_DIR=/var/opt/ignite

PREV=/opt/ignite/old/opt/ignite/newconfig$VAR_DIR/local/manifest/template.def
WRKG=$VAR_DIR/local/manifest/template.def
if [ -f $WRKG -a ! -f $PREV ] ; then
    #
    # If the template.def file was left behind by the original
    # installation of the system, then remove it so that
    # newconfig_prep will not complain about the WRKG version being in
    # place with no PREV version to compare with.
    #
    rm -f $WRKG
fi
SW_LOCATION=/opt/ignite/ newconfig_prep $WRKG

SW_LOCATION=/opt/ignite/ newconfig_prep $VAR_DIR/server/ignite.defs

# Get rid of some obsolete stuff
rm -f \
  /opt/ignite/newconfig/var/opt/ignite/local/manifest/template.hw \
  /opt/ignite/newconfig/var/opt/ignite/local/manifest/template.sw \
  /opt/ignite/old/opt/ignite/newconfig/var/opt/ignite/local/manifest/template.hw \
  /opt/ignite/old/opt/ignite/newconfig/var/opt/ignite/local/manifest/template.sw \
  /var/opt/ignite/local/manifest/template.hw  \
  /var/opt/ignite/local/manifest/template.sw 

exit $SUCCESS
