forked from NASA-AMMOS/common-workflow-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stop_dev.sh
executable file
·34 lines (26 loc) · 841 Bytes
/
stop_dev.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
#!/bin/bash
# ------------
# stop_dev.sh
# ------------
# Stops a running instance of the CWS console and a number of workers. Console and workers are expected to have been
# installed to the dist directory under the CWS root, such as by dev.sh.
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${ROOT}/utils.sh
NUM_WORKERS=${1}
if [[ -z "${NUM_WORKERS}" ]]; then
NUM_WORKERS=4
fi
for ((WORKER_NUM=1; WORKER_NUM <= $NUM_WORKERS; WORKER_NUM++)); do
WORKER_TAG="worker${WORKER_NUM}"
STOP_SCRIPT=${ROOT}/dist/${WORKER_TAG}/cws/stop_cws.sh
if [[ -e ${STOP_SCRIPT} ]]; then
print "Stopping worker ${WORKER_NUM}"
${STOP_SCRIPT}
fi
done
STOP_SCRIPT=${ROOT}/dist/console-only/cws/stop_cws.sh
if [[ -e ${STOP_SCRIPT} ]]; then
print "Stopping console"
${STOP_SCRIPT}
fi
print "Finished"