forked from coreos/torus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
executable file
·38 lines (31 loc) · 916 Bytes
/
entrypoint.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
#!/bin/bash
set -e
: ${LISTEN_HOST:=127.0.0.1}
: ${PEER_ADDRESS:="http://$LISTEN_HOST:40000"}
: ${LISTEN_HTTP_PORT:=4321}
: ${ETCD_HOST:=127.0.0.1}
: ${ETCD_PORT:=2379}
: ${DEBUG:=0}
: ${STORAGE_SIZE:=2GiB}
: ${AUTO_JOIN:=0}
: ${DEBUG_INIT:=0}
: ${DROP_MOUNT_BIN:=0}
: ${LOG_FLAGS:=""}
TORUS_FLAGS=""
if [ ${DEBUG} -eq "1" ]; then
TORUS_FLAGS="$TORUS_FLAGS --debug"
fi
if [ ${AUTO_JOIN} -eq "1" ]; then
TORUS_FLAGS="$TORUS_FLAGS --auto-join"
fi
if [ ${DEBUG_INIT} -eq "1" ]; then
TORUS_FLAGS="$TORUS_FLAGS --debug-init"
fi
if [ ${DROP_MOUNT_BIN} -eq "1" ]; then
mkdir -p /plugin/coreos.com~torus
cp `which torusblk` /plugin/coreos.com~torus/torus
fi
if [ "${LOG_FLAGS}" != "" ]; then
TORUS_FLAGS="$TORUS_FLAGS --logpkg=${LOG_FLAGS}"
fi
torusd --etcd $ETCD_HOST:$ETCD_PORT --host $LISTEN_HOST --port $LISTEN_HTTP_PORT --data-dir /data --peer-address $PEER_ADDRESS --size $STORAGE_SIZE $TORUS_FLAGS