#!/bin/sh
#
# Script for start UML Server and ServerId, needed for
# new version of CUTE.
#

HOST="localhost"
PORT=3000
FILE="tests.uml"

while [ $# -gt 0 ]; do
	
	if [ "$1" = "-?" -o "$1" = "--help"  ]; then
		echo ""
		echo "USAGE: StartServers [-h hostname] [-p port number] [-f filename]"
		echo""
		exit
	fi

	#host name option
	if [ "$1" = "-h" ]; then
		shift
		HOST="$1"
	fi

	#port number option
	if [ "$1" = "-p" ]; then 
		shift
		PORT=$1			
	fi

	#file name option
	if [ "$1" = "-f" ]; then
		shift
		FILE=$1
	fi

	shift

done

#just for testing
#echo $HOST $FILE $PORT
#exit

nohup java BW.UML.ObjId.ServerID $HOST > ServerID.out 2> ServerID.err & 

nohup java TOOL.UML.SERVER.UMLServerApp $PORT $FILE > UMLServerApp.out 2> UMLServerApp.err &

