diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/wsrep_sst_mariabackup.sh | 6 | ||||
-rw-r--r-- | scripts/wsrep_sst_rsync.sh | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh index 4891ade7c3c..3fd93a90c1e 100644 --- a/scripts/wsrep_sst_mariabackup.sh +++ b/scripts/wsrep_sst_mariabackup.sh @@ -520,7 +520,7 @@ kill_xtrabackup() setup_ports() { if [[ "$WSREP_SST_OPT_ROLE" == "donor" ]];then - if [[ ${WSREP_SST_OPT_ADDR:0:1} == '[' ]];then + if [ "${WSREP_SST_OPT_ADDR#\[}" != "$WSREP_SST_OPT_ADDR" ]; then remain=$(echo $WSREP_SST_OPT_ADDR | awk -F '\\][:/]' '{ print $2 }') REMOTEIP=$(echo $WSREP_SST_OPT_ADDR | awk -F '\\]:' '{ print $1 }')"]" SST_PORT=$(echo $remain | awk -F '[:/]' '{ print $1 }') @@ -533,7 +533,7 @@ setup_ports() sst_ver=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $5 }') fi else - if [[ ${WSREP_SST_OPT_ADDR:0:1} == '[' ]];then + if [ "${WSREP_SST_OPT_ADDR#\[}" != "$WSREP_SST_OPT_ADDR" ]; then SST_PORT=$(echo ${WSREP_SST_OPT_ADDR} | awk -F '\\]:' '{ print $2 }') else SST_PORT=$(echo ${WSREP_SST_OPT_ADDR} | awk -F ':' '{ print $2 }') @@ -952,7 +952,7 @@ then if [ -z "${SST_PORT}" ] then SST_PORT=4444 - if [[ ${ADDR:0:1} == '[' ]];then + if [ "${ADDR#\[}" != "$ADDR" ]; then ADDR="$(echo ${WSREP_SST_OPT_ADDR} | awk -F '\\]:' '{ print $1 }')]:${SST_PORT}" else ADDR="$(echo ${WSREP_SST_OPT_ADDR} | awk -F ':' '{ print $1 }'):${SST_PORT}" diff --git a/scripts/wsrep_sst_rsync.sh b/scripts/wsrep_sst_rsync.sh index 1bded37a6b6..6b1a7eb6ee6 100644 --- a/scripts/wsrep_sst_rsync.sh +++ b/scripts/wsrep_sst_rsync.sh @@ -364,7 +364,7 @@ then rm -rf "$RSYNC_PID" ADDR=$WSREP_SST_OPT_ADDR - if [[ ${ADDR:0:1} == '[' ]]; then + if [ "${ADDR#\[}" != "$ADDR" ]; then RSYNC_PORT=$(echo $ADDR | awk -F '\\]:' '{ print $2 }') RSYNC_ADDR=$(echo $ADDR | awk -F '\\]:' '{ print $1 }')"]" else |