#!/bin/csh
#
# This script starts the img_server program for a CTN.
# It requires one argument: The CTN name (ctn1, ctn2, ...)
# $Revision: 1.6 $

if ($1 == "") then
echo "This script requires the CTN Name as an argument (ctn1, ctn2, ....)"
exit
endif

setenv ROOT /mir_ctn/img
setenv QUEUE_DIRECTORY $ROOT/q
setenv D $ROOT/db
setenv I $ROOT/db

set SUCCESS = 1

switch($1)
	case "ctn1":
		set HOST = "ctn1"
		breaksw
	case "ctn2":
		set HOST = "ctn2"
		breaksw
	case "ctn3":
		set HOST = "ctn3"
		breaksw
	case "ctn4":
		set HOST = "ctn4"
		breaksw
	case "ctn5":
		set HOST = "ctn5"
		breaksw
	case "ctn6":
		set HOST = "ctn6"
		breaksw
	case "ctn7":
		set HOST = "ctn7"
		breaksw
	case "demo":
		set HOST = "demo"
		breaksw
	default:
		set SUCCESS = 0
		echo $0\: $1 not found.
		breaksw
endsw

if( $SUCCESS == 1 ) then

img_server -m 0 -q 100 -c $HOST -p 104 $ROOT/config/connect.cfg $ROOT/config/database.cfg &
endif

exit
