#! /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 
### BEGIN INIT INFO
# Provides:          crhws
# Required-Start:    ctrmc
# Required-Stop:
# Default-Start:  2 3 4 5
# Default-Stop:   0 1 6
# Description: CSM Cluster Ready Hardware Server
### END INIT INFO

case "$1" in
        start)
                if [ ! -e /var/opt/csm/.predefined-lpcmds ]
                then
                        /opt/csm/bin/predefined-lpcmds
                        rc=$?
                        /bin/touch /var/opt/csm/.predefined-lpcmds
                else
                        exit 0
                fi
                ;;

        stop)
		if [ -e /var/opt/csm/.predefined-lpcmds ]
                then
                        /bin/rm /var/opt/csm/.predefined-lpcmds
                fi
                exit 0
                ;;

        status)
                /usr/bin/lslpcmd
                rc=$?
                ;;

        restart|reload)
                if [ -e /var/opt/csm/.predefined-lpcmds ]
                then
                        /bin/rm /var/opt/csm/.predefined-lpcmds
                fi
                /opt/csm/bin/predefined-lpcmds
                rc=$?
                ;;

        *)
                echo "Usage: crhws {start|stop|status|restart}"
                exit 1
                ;;
esac

exit $rc

