forked from bmoffit/coda_scripts
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkXterms
executable file
·63 lines (49 loc) · 1.27 KB
/
kXterms
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
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
#
# Kill the xterms spawed with startXterms
#
source ${CODA_SCRIPTS}/setupCODA3.bash
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
rval=$(pgrep -c -U $UID -f "remote_vme")
if [ ! "$rval" == "0" ]; then
verify_or_die "Kill Xterms"
fi
# Hardcoded CODA_SCRIPTS and CODA_COMPONENT_TABLE
. ${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[@]}
rval=$(pgrep -c -U $UID -f "remote_vme.*start${type}.sh")
if [ ! "$rval" == "0" ]; then
echo "Killing local start${type}.sh connections"
pkill -U $UID -f "remote_vme.*start${type}.sh"
fi
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 " Killing $type on $host"
ssh -x -f $host pkill $KILLSTRING
done
fi
done
exit