diff options
author | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2018-06-12 19:39:37 +0300 |
---|---|---|
committer | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2018-06-12 19:39:37 +0300 |
commit | 6e55236c0a72e8f49a240c4e080591994042b0e4 (patch) | |
tree | 4bb2f438004db3dbba5f88f5e4b00aacfd5c1cec /scripts/wsrep_sst_common.sh | |
parent | aa59ecec89d89a29f7272352471a4064aa6db28c (diff) | |
parent | 215d652c66474c4578b0476385d055e7feae2d3a (diff) | |
download | mariadb-git-6e55236c0a72e8f49a240c4e080591994042b0e4.tar.gz |
Merge branch '10.0-galera' into 10.1
Diffstat (limited to 'scripts/wsrep_sst_common.sh')
-rw-r--r-- | scripts/wsrep_sst_common.sh | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/scripts/wsrep_sst_common.sh b/scripts/wsrep_sst_common.sh index 47d9021fe55..50264fe560a 100644 --- a/scripts/wsrep_sst_common.sh +++ b/scripts/wsrep_sst_common.sh @@ -35,18 +35,25 @@ case "$1" in # # Break address string into host:port/path parts # - readonly WSREP_SST_OPT_HOST=${WSREP_SST_OPT_ADDR%%[:/]*} - if [ ${WSREP_SST_OPT_HOST:0:1} = '[' ] - then - # IPv6 notation - readonly WSREP_SST_OPT_HOST_UNESCAPED=${WSREP_SST_OPT_HOST:1:-1} - else - readonly WSREP_SST_OPT_HOST_UNESCAPED=${WSREP_SST_OPT_HOST} - fi - readonly WSREP_SST_OPT_ADDR_PORT=$(echo $WSREP_SST_OPT_ADDR | \ - cut -d ']' -f 2 | cut -s -d ':' -f 2 | cut -d '/' -f 1) + case "${WSREP_SST_OPT_ADDR}" in + \[*) + # IPv6 + addr_no_bracket=${WSREP_SST_OPT_ADDR#\[} + readonly WSREP_SST_OPT_HOST_UNESCAPED=${addr_no_bracket%%\]*} + readonly WSREP_SST_OPT_HOST="[${WSREP_SST_OPT_HOST_UNESCAPED}]" + remain=${WSREP_SST_OPT_ADDR#*\]} + remain=${remain#*:} + ;; + *) + readonly WSREP_SST_OPT_HOST=${WSREP_SST_OPT_ADDR%%[:/]*} + readonly WSREP_SST_OPT_HOST_UNESCAPED=$WSREP_SST_OPT_HOST + remain=${WSREP_SST_OPT_ADDR#*:} + ;; + esac + readonly WSREP_SST_OPT_ADDR_PORT=${remain%%/*} + remain=${remain#*/} + readonly WSREP_SST_OPT_MODULE=${remain%%/*} readonly WSREP_SST_OPT_PATH=${WSREP_SST_OPT_ADDR#*/} - readonly WSREP_SST_OPT_MODULE=${WSREP_SST_OPT_PATH%%/*} remain=${WSREP_SST_OPT_PATH#*/} readonly WSREP_SST_OPT_LSN=${remain%%/*} remain=${remain#*/} @@ -126,10 +133,10 @@ done readonly WSREP_SST_OPT_BYPASS readonly WSREP_SST_OPT_BINLOG -if [ -n "${WSREP_SST_OPT_ADDR:-}" ]; then +if [ -n "${WSREP_SST_OPT_ADDR_PORT:-}" ]; then if [ -n "${WSREP_SST_OPT_PORT:-}" ]; then - if [ -n "$WSREP_SST_OPT_ADDR_PORT" -a "$WSREP_SST_OPT_PORT" != "$WSREP_SST_OPT_ADDR_PORT" ]; then - wsrep_log_error "port in --port=$WSREP_SST_OPT_PORT differs from port in --address=$WSREP_SST_OPT_ADDR" + if [ "$WSREP_SST_OPT_PORT" != "$WSREP_SST_OPT_ADDR_PORT" ]; then + echo "WSREP_SST: [ERROR] port in --port=$WSREP_SST_OPT_PORT differs from port in --address=$WSREP_SST_OPT_ADDR" >&2 exit 2 fi else |