-
Notifications
You must be signed in to change notification settings - Fork 3
/
startCoda
executable file
·106 lines (84 loc) · 2.32 KB
/
startCoda
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/bin/bash
#
# startCoda example script
#
PLATFORM_XPOS=40
PEB_XPOS=$((PLATFORM_XPOS + 400))
ROC_XPOS=$((PEB_XPOS + 400))
PEB_YPOS=40
ROC_YPOS=$((PEB_YPOS))
PEB_YPOS_INCR=400
ROC_YPOS_INCR=400
. coda_conf_functions
# CODA 3 platform needs JAVA_HOME and COOL_HOME defined
if [ -z $JAVA_HOME ]; then
echo "ERROR: \$JAVA_HOME not defined!"
exit 1
fi
if [ -z $COOL_HOME ]; then
echo "ERROR: \$COOL_HOME not defined!"
exit 1
fi
# Check for previous startCoda remnants
pidlist=`pgrep platform; pgrep rcgui; pgrep coda_emu_peb`
if [[ "$pidlist" != "" ]] ; then
echo $pidlist
echo "coda is already running, are you sure you want to start a new coda? this will kill the previous process."
read -p "Input Y or y to start a new coda: " choice
echo $choice
if [ "$choice" != "y" -a "$choice" != "Y" ] ; then
exit
fi
fi
# Kill all previous startCoda remnants
kcoda
# Launch the platform in its own xterm
echo "Starting platform"
xterm -geometry 60x5+${PLATFORM_XPOS}+0 -T "platform" -bg "red" \
-e /bin/bash -c "platform" &
sleep 8
# Launch the rcgui
echo "Starting rcgui"
rcgui &
set_xterm_title_cmd() {
local hostname=$1
local component=$2
local name=$3
local option=
codaconf_get_name_option $hostname $name
option=$CODA_COMPONENT_OPTION
XTERM_TITLE="$hostname : $component: $name"
case "$component" in
"ROC" )
XTERM_COLOR="green"
XTERM_CMD="remote_vme $hostname nobody startROC.sh $name $option"
;;
"PEB" )
XTERM_COLOR="lightblue"
XTERM_CMD="remote_vme $hostname nobody startPEB.sh"
;;
esac
}
# Launch the PEBs
coda_conf_get_component_list PEB
PEB_hosts=${CODA_HOSTNAME_LIST[@]}
for host in $PEB_hosts
do
codaconf_get_component_name $host PEB
set_xterm_title_cmd $host PEB $CODA_COMPONENT_NAME
xterm -geometry 60x25+${PEB_XPOS}+${PEB_YPOS} -T "$XTERM_TITLE" -bg "$XTERM_COLOR" \
-e /bin/bash -c "$XTERM_CMD" &
(( PEB_YPOS += PEB_YPOS_INCR ))
done
# Launch the ROCs
coda_conf_get_component_list ROC
ROC_hosts=${CODA_HOSTNAME_LIST[@]}
for host in $ROC_hosts
do
codaconf_get_component_name $host ROC
set_xterm_title_cmd $host ROC $CODA_COMPONENT_NAME
xterm -geometry 60x25+${ROC_XPOS}+${ROC_YPOS} -T "$XTERM_TITLE" -bg "$XTERM_COLOR" \
-e /bin/bash -c "$XTERM_CMD" &
(( ROC_YPOS += ROC_YPOS_INCR ))
done
exit