From c6d9800d312f35cba2d5131f05953f6a694df015 Mon Sep 17 00:00:00 2001 From: Olli Janatuinen Date: Mon, 2 Aug 2021 03:49:56 -0700 Subject: [PATCH] Correct regex logic used to changing IP addresses --- .../5.0/debian-10/rootfs/opt/bitnami/scripts/librediscluster.sh | 2 +- .../6.0/debian-10/rootfs/opt/bitnami/scripts/librediscluster.sh | 2 +- .../6.2/debian-10/rootfs/opt/bitnami/scripts/librediscluster.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bitnami/redis-cluster/5.0/debian-10/rootfs/opt/bitnami/scripts/librediscluster.sh b/bitnami/redis-cluster/5.0/debian-10/rootfs/opt/bitnami/scripts/librediscluster.sh index 3e48ce9606dc..d5951eae3bb8 100644 --- a/bitnami/redis-cluster/5.0/debian-10/rootfs/opt/bitnami/scripts/librediscluster.sh +++ b/bitnami/redis-cluster/5.0/debian-10/rootfs/opt/bitnami/scripts/librediscluster.sh @@ -203,7 +203,7 @@ redis_cluster_update_ips() { # The node can be new if we are updating the cluster, so catch the unbound variable error if [[ ${host_2_ip_array[$node]+true} ]]; then echo "Changing old IP ${host_2_ip_array[$node]} by the new one ${newIP}" - nodesFile=$(sed "s/${host_2_ip_array[$node]}/$newIP/g" "${REDIS_DATA_DIR}/nodes.conf") + nodesFile=$(sed "s/ ${host_2_ip_array[$node]}:/ $newIP:/g" "${REDIS_DATA_DIR}/nodes.conf") echo "$nodesFile" >"${REDIS_DATA_DIR}/nodes.conf" fi host_2_ip_array["$node"]="$newIP" diff --git a/bitnami/redis-cluster/6.0/debian-10/rootfs/opt/bitnami/scripts/librediscluster.sh b/bitnami/redis-cluster/6.0/debian-10/rootfs/opt/bitnami/scripts/librediscluster.sh index 3e48ce9606dc..d5951eae3bb8 100644 --- a/bitnami/redis-cluster/6.0/debian-10/rootfs/opt/bitnami/scripts/librediscluster.sh +++ b/bitnami/redis-cluster/6.0/debian-10/rootfs/opt/bitnami/scripts/librediscluster.sh @@ -203,7 +203,7 @@ redis_cluster_update_ips() { # The node can be new if we are updating the cluster, so catch the unbound variable error if [[ ${host_2_ip_array[$node]+true} ]]; then echo "Changing old IP ${host_2_ip_array[$node]} by the new one ${newIP}" - nodesFile=$(sed "s/${host_2_ip_array[$node]}/$newIP/g" "${REDIS_DATA_DIR}/nodes.conf") + nodesFile=$(sed "s/ ${host_2_ip_array[$node]}:/ $newIP:/g" "${REDIS_DATA_DIR}/nodes.conf") echo "$nodesFile" >"${REDIS_DATA_DIR}/nodes.conf" fi host_2_ip_array["$node"]="$newIP" diff --git a/bitnami/redis-cluster/6.2/debian-10/rootfs/opt/bitnami/scripts/librediscluster.sh b/bitnami/redis-cluster/6.2/debian-10/rootfs/opt/bitnami/scripts/librediscluster.sh index 3e48ce9606dc..d5951eae3bb8 100644 --- a/bitnami/redis-cluster/6.2/debian-10/rootfs/opt/bitnami/scripts/librediscluster.sh +++ b/bitnami/redis-cluster/6.2/debian-10/rootfs/opt/bitnami/scripts/librediscluster.sh @@ -203,7 +203,7 @@ redis_cluster_update_ips() { # The node can be new if we are updating the cluster, so catch the unbound variable error if [[ ${host_2_ip_array[$node]+true} ]]; then echo "Changing old IP ${host_2_ip_array[$node]} by the new one ${newIP}" - nodesFile=$(sed "s/${host_2_ip_array[$node]}/$newIP/g" "${REDIS_DATA_DIR}/nodes.conf") + nodesFile=$(sed "s/ ${host_2_ip_array[$node]}:/ $newIP:/g" "${REDIS_DATA_DIR}/nodes.conf") echo "$nodesFile" >"${REDIS_DATA_DIR}/nodes.conf" fi host_2_ip_array["$node"]="$newIP"