#! /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
# First (optionally) - -F <flag>
# $1 - host
# $2.. - protocols
FLAG=""
if [ $# = "0" -o $# = "1"  ]; then
	echo Usage: $0 host protocol_list
	exit 1
fi
if [ $1 = "-F" ]; then
	FLAG=$2; shift; shift
fi
if [ $# = "0" -o $# = "1"  ]; then
	echo Usage: $0 host protocol_list
	exit 1
fi
if [ $1 = `hostname` ]; then
	shift
	cd $SPIMSDIR
	for proto in $*; do
		$proto/demon $FLAG $proto/demon.`hostname`.$proto &
	done
elif [ "$FLAG" = "" ]; then
	rsh $1 "(cd \$SPIMSDIR; startdemon $*;)" &
else
	rsh $1 "(cd \$SPIMSDIR; startdemon -F \"$FLAG\" $*;)" &
fi



