#!/bin/ksh
# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
# 61pkgha_r714 src/packages/cluster/es/client/rte/usr/cluster.es.client.rte.unpost_i.sh 1.5.1.1 
#  
# Licensed Materials - Property of IBM 
#  
# COPYRIGHT International Business Machines Corp. 1999,2011 
# All Rights Reserved 
#  
# US Government Users Restricted Rights - Use, duplication or 
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 
#  
# IBM_PROLOG_END_TAG 
# @(#)96        1.5.1.1 src/packages/cluster/es/client/rte/usr/cluster.es.client.rte.unpost_i.sh, pkghacmp, 61pkgha_r714 12/1/11 11:27:38
#

###############################################################################
#
# unpost_i script for the client.rte fileset
#
###############################################################################

###############################################################################
#
#  Name:  onintr
#
#  Rudimentary signal handler
#
#  Arguments:    none
#  Returns:      5 - exit with error
#  Environment:  interrupt handler
#
###############################################################################
function onintr
{
    echo "$0: Caught signal - exiting"
    exit 5
}

###############################################################################
#
#  Name:  if_failed
#
#  Common exit method
#
#  Arguments:    status - return code from some operation
#                errmsg - error message to display (if operation failed)
#
#  Returns:      if status is non 0 exit with error
#  Environment:  installp
#
###############################################################################
function if_failed
{
    status=$1
    errmsg=$2
    if [ $status -ne 0 ]; then
        echo Failed $errmsg
        exit 99
    fi
}

###############################################################################
#
# MAIN
#
###############################################################################

#
# Trap interrupts
#
trap onintr 1 2 3

#
# Establish a rudimentary path
#
PATH=/bin:/usr/bin:/usr/sbin:$PATH


#
# Remove symbolic link for Xclstat in default location
#
LNFILE='/usr/lpp/X11/lib/X11/app-defaults/Xclstat'
if [[ -f ${LNFILE} ]]; then
      rm -f ${LNFILE} 2>/dev/null
      if_failed $? "removing symbolic link ${LNFILE}."
fi

exit 0

