# $Id: gamlinux,v 1.1 2001/01/24 14:27:48 hpnguyen Exp $
#**************************************************************************
#*                COPYRIGHT (C) Mylex Corporation 1992-2001               *
#*                                                                        *
#* This software is furnished under a license and may be used and copied  * 
#* only in accordance with the terms and conditions of such license and   * 
#* with inclusion of the above copyright notice. This software or any     * 
#* other copies thereof may not be provided or otherwise made available   * 
#* to any other person. No title to, nor ownership of the software is     * 
#* hereby transferred.                                                    *
#*                                                                        *
#* The information in this software is subject to change without notices  *
#* and should not be construed as a commitment by Mylex Corporation       *
#*                                                                        *
#**************************************************************************
#
# This script will start any default programs or setup any default values.
# 

case "$1" in
start)
	;;
stop)
	for prog in gamevent gamevlog gamsetsz gamserv gamconfg gamtest ; do
		pids=`ps ax | grep $prog | grep -v grep | awk '{ print $1}'`
		[ "$pids" ] && kill $pids
	done
	pids=`ps ax | grep gamdrvd | grep -v grep | awk '{print $1}{nextfile}'`
	[ "$pids" ] && kill $pids
	exit 0
	;;
*)
	echo "usage $0 start | stop"
	exit 1
	;;
esac

#
#
# GAMDRV DAEMON
# GAMDRV running in User Address Space
#
/usr/bin/gamdrvd 
#
#
# Start asynchronous scan for controllers and devices
# -c option defines the maximum number of channels to be scanned on the generic
#    controller (-c 3 scans channel 0, 1, 2)
# -C option can be used to define specific channels on the generic controller
#    (-C 100 scans channel 2 only).
# -t option defines the maximum number of targets to be scanned on the generic
#    controller (-t 5 scans target 0, 1, 2, 3, 4)
# -T option can be used to define the specific targets on the generic controller
#    (-T 00110 scans target 1 and 2 only)
# The value 1 with option -C or -T means enable the channel/Target.
# The value 0 with option -C or -T means disable the channel/Target.
# With -C and -T, channel/target 0 is the right most digit.
#
#/usr/bin/gamconfg -c 4 -t 16 -T 11111111111111111111111101111111
/usr/bin/gamconfg -c 4 -t 16
#
#
# GAMEVENT
# start the reliable event delivery system mechanism.
# Change the following line according to your need and remove the comment.
#
#/usr/bin/gamevent -k 119 -s 7 -i 158 -e 159 -h host1 -h host2 &
#
#
# GAMEVENT LOG
# start the gamevlog which will log the information in a file.
#
#/usr/bin/gamevlog -f /var/log/gamevlog.log &
#
#
# DRIVE SIZE LIMIT
# Limit the capacity of disk drives. This feature is usefull when you want to
# use the same capacity for different drive models. Please modify the file
# /etc/mylexdrv.siz for appropriate drive model and size or provide/add a
# different file in the command line argument.
#
#/usr/bin/gamsetsz -f /etc/mylexdrv.siz &
#

