forked from membrane/api-gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathservice-proxySSL.sh
More file actions
43 lines (35 loc) · 1.04 KB
/
service-proxySSL.sh
File metadata and controls
43 lines (35 loc) · 1.04 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
#!/bin/bash
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
}
homeSet() {
echo "MEMBRANE_HOME variable is now set"
CLASSPATH="$MEMBRANE_HOME/conf:$MEMBRANE_HOME/lib/*"
export CLASSPATH
echo "Membrane Router running..."
java -classpath "$CLASSPATH" com.predic8.membrane.core.cli.RouterCLI -c proxiesSSL.xml
}
terminate() {
echo "Starting of Membrane Router failed."
echo "Please execute this script from the appropriate subfolder of MEMBRANE_HOME/examples/"
exit 1
}
if ! MEMBRANE_HOME=$(find_membrane_directory "$(pwd)"); then
echo "MEMBRANE_HOME variable is not set and could not be auto-detected."
terminate
fi
export MEMBRANE_HOME
homeSet