From 9e58a2bbdf47b0d5f3623fadda5630ae39892456 Mon Sep 17 00:00:00 2001 From: Aleksander Ivanov Date: Mon, 20 Jan 2020 23:23:34 +0200 Subject: [PATCH] Pattern Matching mistake The current pattern doesn't work for cluster more than 10 nodes. For example: ``` HOSTNAME_SHORT=mongooseim-12 echo ${HOSTNAME_SHORT%-?} ``` Returns mongooseim-12 instead of mongooseim My PR fix this issue. --- member/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/member/start.sh b/member/start.sh index eb84298..5b088a8 100755 --- a/member/start.sh +++ b/member/start.sh @@ -67,7 +67,7 @@ if [ x"${CLUSTER_WITH}" = x"" ]; then # For long hostname - HOST_TAIL will contain all of it but the leading segment HOST_TAIL=$(echo $NODE_HOST | sed -e 's/^[^.]*//') - CLUSTER_WITH="${NODE_NAME}@${HOSTNAME_SHORT%-?}-${MASTER_ORDINAL}${HOST_TAIL}" + CLUSTER_WITH="${NODE_NAME}@${HOSTNAME_SHORT%-*}-${MASTER_ORDINAL}${HOST_TAIL}" DEFAULT_CLUSTERING=1 fi