This is an automated email from the ASF dual-hosted git repository. symat pushed a commit to branch branch-3.5 in repository https://gitbox.apache.org/repos/asf/zookeeper.git
commit fd9219c4f5d4a0e9423cc2fd3d03c86a2edfa6d6 Author: Mohammad Arshad <[email protected]> AuthorDate: Wed Jul 29 12:31:40 2020 +0200 ZOOKEEPER-3876: zkServer.sh status command fails when IPV6 is configured Modified host and IP parsing logic for IPV6 Author: Mohammad Arshad <[email protected]> Reviewers: Enrico Olivelli <[email protected]> Closes #1395 from arshadmohammad/ZOOKEEPER-3876 (cherry picked from commit c9f15213663fc9b86809adcbc27a4dbe1232c31a) Signed-off-by: Enrico Olivelli <[email protected]> (cherry picked from commit f6b7b1b35be13a2bb35f44f58773ba87f5b40b50) --- bin/zkServer.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/zkServer.sh b/bin/zkServer.sh index 1a5056c09..816a12de5 100755 --- a/bin/zkServer.sh +++ b/bin/zkServer.sh @@ -249,7 +249,12 @@ status) echo "Client port not found in the server configs" else if [[ "$clientPortAndAddress" =~ ^.*:[0-9]+ ]] ; then - clientPortAddress=`echo "$clientPortAndAddress" | sed -e 's/:.*//'` + if [[ "$clientPortAndAddress" =~ \[.*\]:[0-9]+ ]] ; then + # Extracts address from address:port for example extracts 127::1 from "[127::1]:2181" + clientPortAddress=`echo "$clientPortAndAddress" | sed -e 's|\[||' | sed -e 's|\]:.*||'` + else + clientPortAddress=`echo "$clientPortAndAddress" | sed -e 's/:.*//'` + fi fi clientPort=`echo "$clientPortAndAddress" | sed -e 's/.*://'` fi
