Merge pull request #32 from olljanat/fix-ip-regex

Correct regex logic used to changing IP addresses
This commit is contained in:
Rafael Ríos Saavedra 2021-08-03 09:05:37 +02:00 committed by GitHub
commit 4385d8a853
3 changed files with 3 additions and 3 deletions

View File

@ -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"

View File

@ -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"

View File

@ -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"