Permalink
Browse files

step1: extract func

  • Loading branch information...
jdvr committed Jul 27, 2017
1 parent c2ecbd3 commit 384cebee187850d928b25717fd74cf676c944e62
Showing with 10 additions and 6 deletions.
  1. +10 −6 create-cluster
View
@@ -20,14 +20,18 @@ redis-server() {
../../src/redis-server $@
}
start_command() {
while [ $((PORT < ENDPORT)) != "0" ]; do
PORT=$((PORT+1))
echo "Starting $PORT"
redis-server --port $PORT --cluster-enabled yes --cluster-config-file nodes-${PORT}.conf --cluster-node-timeout $TIMEOUT --appendonly yes --appendfilename appendonly-${PORT}.aof --dbfilename dump-${PORT}.rdb --logfile ${PORT}.log --daemonize yes
done
exit 0
}
if [ "$1" == "start" ]
then
while [ $((PORT < ENDPORT)) != "0" ]; do
PORT=$((PORT+1))
echo "Starting $PORT"
redis-server --port $PORT --cluster-enabled yes --cluster-config-file nodes-${PORT}.conf --cluster-node-timeout $TIMEOUT --appendonly yes --appendfilename appendonly-${PORT}.aof --dbfilename dump-${PORT}.rdb --logfile ${PORT}.log --daemonize yes
done
exit 0
start_command
fi
if [ "$1" == "create" ]

0 comments on commit 384cebe

Please sign in to comment.