diff options
author | Seppo Jaakola <seppo.jaakola@codership.com> | 2013-05-25 12:22:57 +0300 |
---|---|---|
committer | Seppo Jaakola <seppo.jaakola@codership.com> | 2013-05-25 12:22:57 +0300 |
commit | 9d1546fe2cdced5efb4af831fa2e560b7f80fb54 (patch) | |
tree | 53701c8fc97aa5efce5d901fda1395e82dd49a79 /sql/wsrep_utils.cc | |
parent | 48af4be62a077f5edfadc9b5ea4f6c8c4b00c469 (diff) | |
download | mariadb-git-9d1546fe2cdced5efb4af831fa2e560b7f80fb54.tar.gz |
References: MDEV-4572 - merge with lp:codership-mysql/5.5-23 revisions 3858..3867
Diffstat (limited to 'sql/wsrep_utils.cc')
-rw-r--r-- | sql/wsrep_utils.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sql/wsrep_utils.cc b/sql/wsrep_utils.cc index daba0e4cab2..392fb65d82c 100644 --- a/sql/wsrep_utils.cc +++ b/sql/wsrep_utils.cc @@ -353,10 +353,8 @@ size_t guess_ip (char* buf, size_t buf_len) // try to find the address of the first one #if (TARGET_OS_LINUX == 1) - const char cmd[] = "/sbin/ifconfig | " -// "grep -m1 -1 -E '^[a-z]?eth[0-9]' | tail -n 1 | " - "grep -E '^[[:space:]]+inet addr:' | grep -m1 -v 'inet addr:127' | " - "sed 's/:/ /' | awk '{ print $3 }'"; + const char cmd[] = "ip addr show | grep -E '^\\s*inet' | grep -m1 global |" + " awk '{ print $2 }' | sed 's/\\/.*//'"; #elif defined(__sun__) const char cmd[] = "/sbin/ifconfig -a | " "/usr/gnu/bin/grep -m1 -1 -E 'net[0-9]:' | tail -n 1 | awk '{ print $2 }'"; |