#!/bin/bash
CONF=/etc/config/qpkg.conf
QPKG_NAME="ISB"
Install_Path=$(/sbin/getcfg $QPKG_NAME Install_Path -f $CONF 2>/dev/null)

base=/usr/local/TSPBUS400
if test -d /mnt/md1/bus400; then
	#IcyBox
	base=/mnt/md1/bus400
elif test -n "${Install_Path}" -a -d "${Install_Path}"; then
	base=${Install_Path}
fi
#echo $base

isbs=`ls $base`
for isb in $isbs;  do 
	if test -d $base/$isb -a $isb != "tmp" -a $isb != "bin" -a ${isb:0:1} != "@"; then
		for pgm in tgt73c tgt74c;  do 
#echo $isb $pgm:
			if test -f /tmp/isb_${isb}_${pgm}.pid; then
#echo kill `cat /tmp/isb_${isb}_${pgm}.pid`
				kill `cat /tmp/isb_${isb}_${pgm}.pid`
				rm /tmp/isb_${isb}_${pgm}.pid
			fi;
		done;
	fi;
done
