Fix cluster script to handle "only" default shard
[integration/distribution.git] / karaf / src / main / assembly / bin / configure_cluster.sh
index 5607767eed05a299abf1d45f4363638a0547196c..c3f1a430e0cd7b58d978a31452296e4f4e85d2e5 100755 (executable)
@@ -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