#! /bin/sh
#
#
# Copyright (c) 1996-1999 by Sun Microsystems, Inc.
# All rights reserved.
#
#pragma ident	"@(#)postremove	1.10	00/07/13 SMI"
#
#
#
###########################################################################
#
# postremove for SUNWscssv
#
#	* Remove entries from help configuration file
#
###########################################################################

PATH=/usr/bin:/usr/sbin:${BASEDIR}/SUNWsymon/sbin
export PATH

PKGNAME=SUNWscssv
PROG=${PKGNAME}.postremove

###########################################
#
# is_symon_help_exist
#
#	Check if symon-help-j.x file exist
#
###########################################
is_symon_help_exist()
{
	help_file=${BASEDIR}/SUNWsymon/classes/base/console/cfg/symon-help-j.x

	if [ ! -f $help_file ]
	then
		echo "$help_file: file not exist"
		return 1
	fi
}

###########################################
#
# remove_help_entries
#
#	Remove entries from help configuration file
#
###########################################
remove_help_entries()
{
	mkdir -p /tmp/${BASEDIR}/SUNWsymon/sbin
	if [ $? != 0 ]; then return 1; fi

	es-chelp -d sc-gen-stat-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-gen-prop-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-nodes-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-nodes-stat-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-nodes-prop-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-devGrp-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-devGrp-stat-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-devGrp-prop-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-quorum-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-quorum-stat-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-quorum-prop-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-transp-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-transp-stat-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-transp-prop-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-rt-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-rt-prop-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-rt-method-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-rt-param-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-rt-resources-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-rg-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-rg-prop-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-rg-stat-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-fo-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-fo-stat-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-fo-prop-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-fo-resources-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-fo-method-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-ss-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-ss-stat-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-ss-prop-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-ss-resources-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-ss-method-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-gen-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-trans-stat-help
	if [ $? != 0 ]; then return 1; fi
	es-chelp -d sc-trans-prop-help
	if [ $? != 0 ]; then return 1; fi

}

###########################################
#
# main
#
###########################################

# catch common signals
trap 'echo "${PROG}: caught signal"; exit 1' 1 2 3 15

is_symon_help_exist
if [ $? != 0 ]; then exit 0; fi

remove_help_entries
if [ $? != 0 ]; then exit 1; fi
