#!/bin/tcsh -f
#==============================================================
#
#  Abs:  cmdSrv script to execute the LI21 Magnet Display
#
#  Name: csli21mg
#
#  Rem: This file is executed by the "Command Server" program cmdSrv.
#
#       It is better to use exec below rather than just running a program (eg edm).
#       That's because the client KILL command doesn't work as we would like
#       it if we run the program.  That's because running a program would fork
#       a child to run the program.  Then, we would KILL only the parent of 
#       that child (the one forked from cmdSrv).
#
#       If you do run the program (instead of exec'ing it),
#       NEVER run in background (with & after it).
#       That will mess up the way cmdSrv tests for completion of the
#       child that this script is executing in.  It would cause cmdSrv
#       to think that the child terminated immediately.
#
#  Usage:  send a command to cmdSrv to execute this script
# 
#  Facility: 
#
#  Auth: 28-Mar-2007, K. Luchini         (LUCHINI)
#  Rev:  dd-mmm-yyyy, Reviewer's Name    (USERNAME)
#
#--------------------------------------------------------------
#  Mod:
#        30-Mar-2007, K. Luchini         (LUCHINI):
#          chagne display from mgnt_li21_all.edl
#          to mgnt_li21_all.edl
#
#==============================================================
#
# Does the setup script for lcls exist? If not, just exit.
if (-e /afs/slac/g/lcls/tools/cmdSrv/script/csEnvs.csh) then
    source /afs/slac/g/lcls/tools/cmdSrv/script/csEnvs.csh 

# All channel access is through the gateway
# No direct IOC connections allowed for this program.
# setenv EPICS_CA_ADDR_LIST "134.79.48.11 134.79.51.48 134.79.51.127"
#
# Now, run the display 
#
  exec edm -x -eolc mgnt_li21_all.edl >& /dev/null
endif

# End of script

