summaryrefslogtreecommitdiff
path: root/sql/wsrep_utils.cc
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2014-12-08 23:44:53 -0500
committerNirbhay Choubey <nirbhay@mariadb.com>2014-12-08 23:44:53 -0500
commite51e5e940c5c0b2cfd1a9bc07833a933a0460c4e (patch)
tree5f97e952ea643ed0c16282d97f46ac236368f583 /sql/wsrep_utils.cc
parent3bb02f3e6d70687b02c6902fd6478e8c328608f8 (diff)
downloadmariadb-git-e51e5e940c5c0b2cfd1a9bc07833a933a0460c4e.tar.gz
Merged patch for lp:1167368 from maria-5.5-galera.
Diffstat (limited to 'sql/wsrep_utils.cc')
-rw-r--r--sql/wsrep_utils.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/sql/wsrep_utils.cc b/sql/wsrep_utils.cc
index 14239c88785..64b9fb35b48 100644
--- a/sql/wsrep_utils.cc
+++ b/sql/wsrep_utils.cc
@@ -407,10 +407,8 @@ size_t wsrep_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 '^[[:space:]]*inet' | grep -m1 global |"
+ " awk '{ print $2 }' | sed -e '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 }'";