#! /bin/sh
# The SPIMS software is covered by a license. The use of the software
# represents acceptance of the terms and conditions in the license.
# ******************************************************************
# Copyright (c) 1989, Swedish Institute of Computer Science
# parameters: host names and protocol names - see file <startdemons>
DEF_PROTOCOLS="udp tcp ftp sunrpc tcprpc null"
DEF_HOSTS=`hostname`
ALL_HOSTS=""
PROTOCOLS=""
HOSTS=""
for p in $@; do
	if [ $p = "ALL" ]; then
		HOSTS=$ALL_HOSTS;
	elif [ -d $SPIMSDIR/$p ]; then
		PROTOCOLS="$PROTOCOLS $p"
	else
		HOSTS="$HOSTS $p"
	fi
done
if [ "$HOSTS" = "" ]; then
	HOSTS=$DEF_HOSTS
fi
if [ "$PROTOCOLS" = "" ]; then
	PROTOCOLS=$DEF_PROTOCOLS
fi
echo Killing benchmark demons on $HOSTS for the $PROTOCOLS protocols
for host in $HOSTS; do
	killdemon $host $PROTOCOLS
done

