#!/bin/csh -f
# script to start all or a basic set of tools.

# check for -all
if ($#argv > 0) then
    if ("$argv[1]" != "-all") then
	echo "$0:t"':'" [-all]"
	exit 1
    endif
    set all;
endif

echo -n "Starting: "

echo -n "telescoped "
rund telescoped
set n = 20
while ($n > 0)
    sleep 1
    if (-p $TELHOME/comm/Focus.in) break
    echo -n "."
    @ n --
end
if ($n == 0) then
    echo ""
    echo telescoped failed to start
    tail $TELHOME/archive/logs/telescoped.log
    exit 1
endif

echo -n "xobs "
(xobs &) >& /dev/null

# that's it if just want the basic set
if (! $?all) goto done

echo -n "camerad "
rund camerad

echo -n "shm "
(shm -lq &) >& /dev/null

echo -n "camera "
(camera &) >& /dev/null

echo -n "xephem "
(xephem &) >& /dev/null

# echo -n "telsched "
(telsched &) >& /dev/null

done:
echo ""

# For RCS Only -- Do Not Edit
# @(#) $RCSfile: startTel,v $ $Date: 2003/04/15 20:48:39 $ $Revision: 1.1.1.1 $ $Name:  $
