#!/bin/ksh

# @(#)26   1.2   src/csm/hw/hs/reg_peer_event, csm.hardware, csm_rgarh 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
