#!/bin/csh
#
# Shell script to use 'pcomm' to talk to the OASIS mooring controller
#
# Currently, the connections are defined as follows
# mooring:connection

set noglob
set connection=dev_tnc
set m1con=m1
set m2con=m2

if ( ($#argv == 0)) then
echo "\nUsage - $0:t <connection>" 
echo "connection: m1|m2|tnc1|tnc2\n"
exit 0
endif

if ( ($#argv > 0)) then
switch($argv[1])
case "tnc1":
set connection = dev_tnc
breaksw
case "tnc2":
set connection = dev_tnc2
breaksw
case "m1":
set connection = $m1con
breaksw
case "m2":
set connection = $m2con
breaksw
default:
echo "\nUsage - $0:t <connection>" 
echo "connection: m1|m2|tnc1|tnc2\n"
exit 0
breaksw
endsw
endif

cd /oasis/raw/logs
/bin/more -d /oasis/ACCESS
/usr/local/bin/pcomm -f $connection
