-
Notifications
You must be signed in to change notification settings - Fork 166
Expand file tree
/
Copy pathlbclient.sh
More file actions
executable file
·45 lines (38 loc) · 1.13 KB
/
lbclient.sh
File metadata and controls
executable file
·45 lines (38 loc) · 1.13 KB
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
#!/bin/bash
ARGUMENTS="$@"
homeSet() {
echo "MEMBRANE_HOME is now set to $MEMBRANE_HOME"
if [ -n "$JAVA_HOME" ]; then
exec java -cp "${JAVA_HOME}/jre/lib/ext/*:${MEMBRANE_HOME}/lib/*" \
com.predic8.membrane.balancer.client.LBNotificationClient $ARGUMENTS
else
echo "Please set the JAVA_HOME environment variable."
exit 1
fi
}
terminate() {
echo "Starting of Membrane Router Load Balancer Client failed."
echo "Please execute this script from the MEMBRANE_HOME/examples/loadbalancer-client-2 directory"
exit 1
}
find_membrane_directory() {
candidate=${MEMBRANE_HOME:-$membrane_home}
if [ -n "$candidate" ] && [ -f "$candidate/LICENSE.txt" ]; then
echo "$candidate"
return 0
fi
current="${1:-$(pwd)}"
while [ "$current" != "/" ]; do
if [ -f "$current/LICENSE.txt" ]; then
echo "$current"
return 0
fi
current=$(dirname "$current")
done
return 1
}
if ! MEMBRANE_HOME=$(find_membrane_directory "$(pwd)"); then
echo "MEMBRANE_HOME variable is not set and could not be auto-detected."
terminate
fi
homeSet