From 71c81ea2c87898a648ff82b3f138845340c15129 Mon Sep 17 00:00:00 2001 From: Luis Gomez Date: Thu, 21 Jun 2018 12:52:02 -0700 Subject: [PATCH] Fix cluster script to handle "only" default shard This is when custom_shard_config.txt is empty. Change-Id: I61f07071dbe2d08a004ee53183ae976c4b343883 Signed-off-by: Luis Gomez --- karaf/src/main/assembly/bin/configure_cluster.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/karaf/src/main/assembly/bin/configure_cluster.sh b/karaf/src/main/assembly/bin/configure_cluster.sh index 5607767e..c3f1a430 100755 --- a/karaf/src/main/assembly/bin/configure_cluster.sh +++ b/karaf/src/main/assembly/bin/configure_cluster.sh @@ -108,8 +108,13 @@ function modules_builder count=$[count + 1] done - # using ::-1 below to remove the extra comma we get from the above loop - echo -e ${modules_string::-1}"\n]" + if [ ${count} == 1 ]; then + # if no modules found in custom_shard_config.txt just close the bracket + echo -e ${modules_string}"\n]" + else + # using ::-1 below to remove the extra comma we get from the above loop + echo -e ${modules_string::-1}"\n]" + fi } function get_cli_params -- 2.36.6