#!/bin/bash
#
# Name: install_elxlpfc_svc
# Copyright: (c)Copyright 2007 Hewlett-Packard Development Company, L.P.
#
# Description: Installs the elxlpfc service to load lpfcdfc.ko at boot time
#
# Modification History
#
# CD	03/15/07	Initial Development

#
# Defines
#

WRKDIR=/opt/hp/hp-lpfc
DFCSTART=elxlpfc

# install elxlpfc startup script
#
if test -f $WRKDIR/$DFCSTART
then
 echo "Installing elxlpfc startup script for lpfcdfc"

 if test -f /etc/redhat-release
 then
 	# we are redhat

 	cd $WRKDIR
 	cp $DFCSTART /etc/rc.d/init.d
 	chkconfig --add $DFCSTART
 	chkconfig --level 2345 $DFCSTART on
 	cd - 1>/dev/null 2>/dev/null

 elif test -f /etc/SuSE-release || test "`cat /etc/issue | grep UnitedLinux`" != ""
 then
 	# we are suse

 	cd $WRKDIR
 	cp $DFCSTART /etc/rc.d
 	chkconfig --add $DFCSTART
 	chkconfig $DFCSTART on
 	cd - 1>/dev/null 2>/dev/null
 else
 	echo "Installation of lpfcdfc startup script aborted because of unknown distribution"
 fi
else
 echo "Could not install DFC startup script because $WRKDIR/$DFCSTART does not exist"
fi
