-
Notifications
You must be signed in to change notification settings - Fork 3
/
run.sh
executable file
·45 lines (36 loc) · 897 Bytes
/
run.sh
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
#!/bin/bash
set -eu
if [[ $# -ne 1 ]]; then
echo "Usage: $0 start|stop|restart" >&2
exit 1
fi
BASE_DIR="$( pwd )"
start() {
cd "$BASE_DIR/legacy-web/build/libs"
chmod 755 legacy-web.jar
./legacy-web.jar start
cd "$BASE_DIR/modern-web/build/libs"
chmod 755 modern-web.jar
./modern-web.jar start
echo "wait for applicatoin running..."
sleep 15
echo " applicatoin running at:"
echo " - Legacy Web: http://localhost:9000/"
echo " - Modern Web: http://localhost:9100/"
}
stop() {
cd "$BASE_DIR/legacy-web/build/libs"
chmod 755 legacy-web.jar
./legacy-web.jar stop
cd "$BASE_DIR/modern-web/build/libs"
chmod 755 modern-web.jar
./modern-web.jar stop
}
case "$1" in
start) start ;;
stop) stop ;;
restart) stop; start ;;
*) echo "usage: $0 start|stop|restart" >&2
exit 1
;;
esac