forked from bmoffit/coda_scripts
-
Notifications
You must be signed in to change notification settings - Fork 1
/
restartXterms
executable file
·52 lines (41 loc) · 1.04 KB
/
restartXterms
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
#
# restartXterms: restart CODA components started with startXterms
# They should restart on their own, if they are run with
# the startXterms script
#
if [ ${#@} -gt 0 ]; then
# Get the CODA_COMPONENT_TABLE
CODA_COMPONENT_TABLE=$1
fi
#echo "Using CODA_COMPONENT_TABLE=${CODA_COMPONENT_TABLE}"
. ${CODA_SCRIPTS}/coda_xterms_functions
# Check first for any running remote_vme
verify_or_die "Restart All CODA Components"
. ${CODA_SCRIPTS}/coda_conf_functions
TYPES=( "TS" "ROC" "FPGA" "PEB" "SEB" "ER" "DC" )
for type in ${TYPES[@]}
do
coda_conf_get_component_list $type
if [ $? == 1 ] ; then
hosts=${CODA_HOSTNAME_LIST[@]}
case "$type" in
"TS" )
KILLSTRING="coda_ts"
;;
"ROC" | "FPGA" )
KILLSTRING="coda_roc"
;;
"PEB" | "ER" | "SEB" | "DC" )
KILLSTRING="-f org.jlab.coda.emu.EmuFactory"
;;
esac
# now kill the ROC, if it's still runnin gon the remote host
for host in $hosts
do
echo " Restarting $type on $host"
ssh -x -f $host pkill $KILLSTRING
done
fi
done
exit