Skip to content
Snippets Groups Projects
Forked from DM / dm-docs
261 commits behind, 811 commits ahead of the upstream repository.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
dm_remote_control.sh 764 B
#!/bin/sh

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

# Format is DISPLAY_NAME:MACHINE:HOME_DIRECTORY:SERVICE_TYPE
STATION_LIST="CentralStorage:apsgpfs08:dm:ds 1ID:pinotnoir:dm:daq 6IDD:s6iddm:dm:daq 6BM:s6bmdm:dm:daq 7ID:gremlin:dm:daq 8IDI:amethyst:dm:daq 11IDB:s11idbdm:dm_idb:daq 11IDC:s11idcdm:dm_idc:daq 33ID:sis:dm:daq 34IDE:hpcs34:dm:daq"

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