#!/bin/csh -f
#+
#OSIRIS library of scripts
#
#NAME
#     ao2real - disconnects AO simulator
#
#SYNOPSIS
#     ao2real (no arguments)
#
#DESCRIPTION
#     disconnects the AO simulator and sets the software to use the
#     real hardware
#
#OPTIONS
#     no options available
#
#EXAMPLES
#     ao2real
#
#ENVIRONMENT VARIABLES
#     none
#
#FILES
#     none
#
#SERVERS & KEYWORDS
#     service = ao
#          keywords: aosim
#
#SCRIPTS CALLED
#     help, syncheck
#
#EXIT STATUS
#     0 - normal exit, no error
#     1 - script aborted by an interrupt
#     2 - syncheck error
#
#SEE ALSO
#     ???
#-
#
# Modification History:
# 20050219 - MB: Adapted from NIRC2 scripts
#

# Boiler plate for "-h" support for command autohelp.

if ("$1" == "-h") then
    help $0 | more
    exit $status
endif

# Boilerplate for syncheck.
# Note that the boiler plate should be transparent for all usages,
# but to make correct use of syncheck you will need to specify the
# correct pattern.

 set noglob
 set CheckStatus = `syncheck -command $0 $* -pattern ` 
 unset noglob

if ("$CheckStatus" != "OK") then
    help $0 | more
    exit 2
endif

# End of help/syncheck boiler plate.

modify -s ao aosim = false
echo ""
echo WARNING: You are now using the REAL AO hardware\!\!
echo ""