forked from Concordium/concordium-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.sh
executable file
·41 lines (34 loc) · 842 Bytes
/
start.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
#!/usr/bin/env bash
# SIGTERM handler
_term() {
kill -TERM ${CHILD_PID} 2>/dev/null
wait ${CHILD_PID}
}
# Haskell binding needs proper library path to function
export LD_LIBRARY_PATH=/usr/local/lib
if [ -z "$CONCORDIUM_NODE_CONFIG_DIR" ]; then
echo "CONCORDIUM_NODE_CONFIG_DIR must be set."
exit 1
else
mkdir -p $CONCORDIUM_NODE_CONFIG_DIR
fi
if [ -z "$CONCORDIUM_NODE_DATA_DIR" ]; then
echo "CONCORDIUM_NODE_DATA_DIR must be set."
exit 1
else
mkdir -p $CONCORDIUM_NODE_DATA_DIR
fi
if [ -n "$DISTRIBUTION_CLIENT" ];
then
# Tell the node where to find the genesis file.
export CONCORDIUM_NODE_CONSENSUS_GENESIS_DATA_FILE=/genesis.dat
fi
if [ -n "$ENABLE_TERM_HANDLER" ];
then
trap _term SIGTERM
/concordium-node $ARGS &
CHILD_PID=$!
wait $CHILD_PID
else
/concordium-node $ARGS
fi