#!/bin/ksh
# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
#  
#  
# Licensed Materials - Property of IBM 
#  
# (C) COPYRIGHT International Business Machines Corp. 2005,2007 
# 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 

# @(#)26   1.2   src/csm/hw/hs/reg_peer_event, csm.hardware, csm_rfish, rfishs001b 4/20/05 18:18:25

# disable this reg func right now because HMC people against 
# dynamically change between cluster mode and standalone mode

exit 0

# register event when this hmc is moved in or outof peer domain

/opt/csm/csmbin/waitForRsct IBM.ERRM

/usr/sbin/rsct/bin/mkcondition -r IBM.PeerDomain -e "OpState <= 2"  -m l PeerDomainChanged
#I recommend to use OpState instead of ConfigChanged for this purpose
#since action should be taken when OpState is changed to on/off.

/usr/sbin/rsct/bin/mkresponse -n "Restart Hardware Server" -s /opt/hsc/hdwr_svr/restartHDWR_SVR RestartHardwareServer
#If you want your script to be run when PeerDomain is removed,  "-u" option is required.

/usr/sbin/rsct/bin/startcondresp PeerDomainChanged RestartHardwareServer
#to make sure your script returns rc=0

#we do not want post install to fail, so just return success
exit 0
