#!/bin/sh
#
# isicom	This loads the driver and firmware for Multitech ISI cards.
#
# chkconfig: - 10 90
# description: 	This runs the hardware probe, and optionally configures \
#		changed hardware.

# Source function library.
. /etc/rc.d/init.d/functions

case "$1" in
 start)
	echo -n $"Loading PLX (isicom) modules... "
	/sbin/modprobe isicom
	if [ $? -eq 0 ]; then
		action "" /bin/true
		echo $"Loading isicom firmware... "
		/usr/sbin/firmld
		if [ $? -eq 0 ]; then
			action "" /bin/true
		else
			rmmod isicom
			action $"Failed to load firmware." /bin/false
		fi
	else
		action $"Failed to load module: isicom" /bin/false
		exit
	fi

	;;
 stop)
		echo -n $"Disabling PLX devices... "
		rmmod isicom
		if [ $? -eq 0 ]; then
			action "" /bin/true
		else
			action "" /bin/false
		fi
 	;;

 restart)
		$0 stop
		$0 start
	;;

 reload)
		$0 restart
	;;
 *)
 	echo $"Usage: $0 {start|stop|restart|reload}"
	exit 1
	;;
esac
