Commit a15ab358 authored by Sergei Golubchik's avatar Sergei Golubchik

wsrep_sst scripts: support traditional netcat

parent 89b0d5cb
......@@ -179,12 +179,26 @@ get_transfer()
wsrep_log_info "Using netcat as streamer"
if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
if nc -h 2>&1 | grep -q ncat;then
# Ncat
tcmd="nc -l ${TSST_PORT}"
else
elif nc -h 2>&1 | grep -q -- '-d\>';then
# Debian netcat
tcmd="nc -dl ${TSST_PORT}"
else
# traditional netcat
tcmd="nc -l -p ${TSST_PORT}"
fi
else
tcmd="nc ${REMOTEIP} ${TSST_PORT}"
if nc -h 2>&1 | grep -q ncat;then
# Ncat
tcmd="nc ${REMOTEIP} ${TSST_PORT}"
elif nc -h 2>&1 | grep -q -- '-d\>';then
# Debian netcat
tcmd="nc ${REMOTEIP} ${TSST_PORT}"
else
# traditional netcat
tcmd="nc -q0 ${REMOTEIP} ${TSST_PORT}"
fi
fi
else
tfmt='socat'
......
......@@ -268,13 +268,26 @@ get_transfer()
wsrep_log_info "Using netcat as streamer"
if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
if nc -h 2>&1 | grep -q ncat; then
# Ncat
tcmd="nc $sockopt -l ${TSST_PORT}"
else
elif nc -h 2>&1 | grep -q -- '-d\>';then
# Debian netcat
tcmd="nc $sockopt -dl ${TSST_PORT}"
else
# traditional netcat
tcmd="nc $sockopt -l -p ${TSST_PORT}"
fi
else
# netcat doesn't understand [] around IPv6 address
tcmd="nc ${WSREP_SST_OPT_HOST_UNESCAPED} ${TSST_PORT}"
if nc -h 2>&1 | grep -q ncat;then
# Ncat
tcmd="nc ${WSREP_SST_OPT_HOST_UNESCAPED} ${TSST_PORT}"
elif nc -h 2>&1 | grep -q -- '-d\>';then
# Debian netcat
tcmd="nc ${WSREP_SST_OPT_HOST_UNESCAPED} ${TSST_PORT}"
else
# traditional netcat
tcmd="nc -q0 ${WSREP_SST_OPT_HOST_UNESCAPED} ${TSST_PORT}"
fi
fi
else
tfmt='socat'
......
......@@ -144,12 +144,26 @@ get_transfer()
wsrep_log_info "Using netcat as streamer"
if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
if nc -h 2>&1 | grep -q ncat;then
# Ncat
tcmd="nc -l ${TSST_PORT}"
else
elif nc -h 2>&1 | grep -q -- '-d\>';then
# Debian netcat
tcmd="nc -dl ${TSST_PORT}"
else
# traditional netcat
tcmd="nc -l -p ${TSST_PORT}"
fi
else
tcmd="nc ${WSREP_SST_OPT_HOST_UNESCAPED} ${TSST_PORT}"
if nc -h 2>&1 | grep -q ncat;then
# Ncat
tcmd="nc ${REMOTEIP} ${TSST_PORT}"
elif nc -h 2>&1 | grep -q -- '-d\>';then
# Debian netcat
tcmd="nc ${REMOTEIP} ${TSST_PORT}"
else
# traditional netcat
tcmd="nc -q0 ${REMOTEIP} ${TSST_PORT}"
fi
fi
else
tfmt='socat'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment