#!/bin/bash

echo "###################################################"
echo "## Stop MVACS data pipeline"
echo "##"
echo Stop time: `/bin/date`

declare -r phase=$1

echo "Phase = $phase  ($1)"

if [ -z $phase ]; then
	echo "Calling:   fwStop.bash <mission phase>"
	echo "<mission phase> = mort5, ort3 ..."
	exit -1
fi

echo Here

declare base_dir=/proj/ops/ssi/$phase/queues


cd $base_dir

for d in $base_dir/*; do
	if [ -d $d ]; then
		echo "Stopping $d"
		touch $d/stop.rtc
	fi
done