#!/bin/bash -e num_args=$# # # McIDAS data can be served from either a SDI or a workstation having data mounted from the SDI # # # The SDI publishes and serves the RabbitMQ messages. The IP number SDI is required for listening # to the published messages. The RabbitMQ messages published by the SDI contain both path location # of the data and a McIDAS ADDE dataset name. # # If using NFS as your source of data, both the IP address of the SDI and the workstation having # data mounted from the SDI must be specified. If this is the case the the path location and # ADDE dataset information may be invalid. A sample RESOLV.SRV file is contained on the test stick # and should be copied to ~mcadde/mcidas/data. # echo " " if [[ ${num_args} -eq 0 ]]; then echo "Usage:" echo "mcidas-event.bash {data source type SDI | NFS} {IP of SDI} {IP of McIDAS Server}" echo "Positional parameters must be specified" exit 1 else data_source=$1 fi if [[ ${data_source} = "SDI" ]]; then if [[ ${num_args} -lt 2 ]]; then echo "Usage:" echo "IP of SDI must be specified" exit 1 else sdi_server=$2 mcidas_server=$2 export MCIDAS_DATA_SOURCE=${data_source} export SDI_SERVER_IP=${sdi_server} export MCIDAS_SERVER_IP=${mcidas_server} fi elif [[ ${data_source} = "NFS" ]]; then if [[ ${num_args} -lt 3 ]]; then echo "Usage:" echo "mcidas-event.bash {data source type} {IP of SDI} {IP of McIDAS Server}" exit 1 else sdi_server=$2 mcidas_server=$3 export MCIDAS_DATA_SOURCE=${data_source} export SDI_SERVER_IP=${sdi_server} export MCIDAS_SERVER_IP=${mcidas_server} fi else echo "Usage:" echo "mcidas-event.bash {data source type} {IP of SDI} {IP of McIDAS Server}" echo "Either SDI or McIDAS must be specified for first parameter" exit 1 fi export CORE_MCIDAS=/home/mcidas export CORE_DATA=$CORE_MCIDAS/data export CORE_BIN=$CORE_MCIDAS/bin export CORE_MCIDAS_EXE=$CORE_BIN/mcidas export USER_DATA=$HOME/sdi_test export MCPATH=$USER_DATA:$CORE_DATA export PATH=$CORE_BIN:$PATH # # Check to see if mcidas can be found # if ! [[ -x "$CORE_MCIDAS_EXE" ]] ; then echo "File '$CORE_MCIDAS_EXE' is not executable or found" exit 1 fi # # This amqpfind command triggers off a python script when a band end has completed # echo "Starting McIDAS access using RabbitMQ message" echo "$HOME/Client-Testing/amqpfind/amqpfind -p guest -u guest -H $SDI_SERVER_IP -C geo.goes.g16.abi.*.*.*.*.end | xargs -P1 -n2 python $HOME/Client-Testing/scripts/mcidas-event.py" $HOME/Client-Testing/amqpfind/amqpfind -p guest -u guest -H $SDI_SERVER_IP -C geo.goes.g16.abi.*.*.*.*.end | xargs -P1 -n2 python $HOME/Client-Testing/scripts/mcidas-event.py # # This amqpfind command triggers off a python script when an entire image has completed # # echo "$HOME/Client-Testing/amqpfind/amqpfind -p guest -u guest -H $SDI_SERVER_IP -C geo.goes.g16.abi.*.*.*.image.complete | xargs -P1 -n2 python $HOME/Client-Testing/scripts/mcidas-event.py" # $HOME/Client-Testing/amqpfind/amqpfind -p guest -u guest -H $SDI_SERVER_IP -C geo.goes.g16.abi.*.*.*.image.complete | xargs -P1 -n2 python $HOME/Client-Testing/scripts/mcidas-event.py exit 0