#!/bin/sh

ACTION=$1
ACTION=${ACTION:=status}
echo $0: ACTION=$ACTION
echo

STATION_LIST="CentralStorage:apsgpfs08:ds 1ID:pinotnoir:daq 6IDD:s6iddm:daq 6BM:s6bmdm:daq 7ID:gremlin:daq 8IDI:amethyst:daq 33ID:sis:daq 34IDE:hpcs34:daq"

for s in $STATION_LIST ; do
    stationName=`echo $s | cut -f1 -d':'`
    nodeName=`echo $s | cut -f2 -d':'`
    scriptName=`echo $s | cut -f3 -d':'`
    echo "**********************************"
    echo "Station: $stationName ($nodeName)"
    ssh dmadmin@$nodeName "/home/dm/production/etc/init.d/dm-${scriptName}-services $ACTION"
    echo
done
