Skip to content

Commit ffe225c

Browse files
committed
fixing bash
1 parent 91cde91 commit ffe225c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

docker/base/create_cluster.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
mkdir -p /nodes
44
touch /nodes/nodemap
5-
if [ -z ${START_PORT}]; then
5+
if [ -z ${START_PORT} ]; then
66
START_PORT=16379
77
fi
8-
if [ -z ${END_PORT}]; then
8+
if [ -z ${END_PORT} ]; then
99
END_PORT=16384
1010
fi
1111
if [ ! -z "$3" ]; then
@@ -38,5 +38,9 @@ EOF
3838
fi
3939
echo 127.0.0.1:$PORT >> /nodes/nodemap
4040
done
41-
echo yes | redis-cli --cluster create $(seq -f 127.0.0.1:%g ${START_PORT} ${END_PORT}) --cluster-replicas 1
41+
if [ -z "${REDIS_PASSWORD}" ]; then
42+
echo yes | redis-cli --cluster create $(seq -f 127.0.0.1:%g ${START_PORT} ${END_PORT}) --cluster-replicas 1
43+
else
44+
echo yes | redis-cli -a ${REDIS_PASSWORD} --cluster create $(seq -f 127.0.0.1:%g ${START_PORT} ${END_PORT}) --cluster-replicas 1
45+
fi
4246
tail -f /redis.log

0 commit comments

Comments
 (0)