forked from eloots/Pi-Akka-Cluster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run
executable file
·32 lines (22 loc) · 1.08 KB
/
run
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
#!/bin/bash
######################################################################
# Run this script on a PI node with the exercise number as a single argument
#
# Example: ./run 7
#
######################################################################
EXERCISE_NR=`printf %03d $1`
FATJAR=`ls exercise*${EXERCISE_NR}*jar`
CINNAMON="cinnamon-agent.jar"
NODE=`hostname`
echo "Running $FATJAR on $NODE"
sudo pkill -SIGKILL -f "exercise.*_[0-9][0-9][0-9]_.*"
shift
if [ -f setLedType ];then
. ./setLedType
fi
if [ -f $CINNAMON ];then
CINNAMON_AGENT="-javaagent:$CINNAMON"
fi
LedStripType=${LED_STRIP_TYPE:-eight-led-reversed-order}
sudo java $CINNAMON_AGENT -Djava.library.path=. -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcluster-node-configuration.node-hostname=$NODE -Dakka.management.http.hostname=${NODE} -Dcluster-status-indicator.led-strip-type=$LedStripType -jar $FATJAR "com.neopixel.ClusterStatusTrackerMain $@"