#!/bin/sh
#
# isicom	This loads the driver and firmware for Multitech ISI cards.
#
# chkconfig: - 10 90
# description: 	The isicom package contains the binary images and loader for \
# Multi-Tech Systems Intelligent Serial Interface(TM) (ISI) data \
# files. Multi-Tech ISI multiport serial cards provide additional serial \
# ports for remote access servers, multi-user hosts and PCs. 

# 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
			touch /var/lock/subsys/isicom
		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
			rm -f /var/lock/subsys/isicom
		else
			action "" /bin/false
		fi
 	;;

 status)
		status isicom
	;;

 restart)
		$0 stop
		$0 start
	;;

 reload)
		$0 restart
	;;

 condrestart)
		[ -f /var/lock/subsys/isicom ] && restart || :
	;;
 *)
 	echo $"Usage: ${0##*/} {start|stop|status|restart|reload|condrestart}"
	exit 1
	;;
esac