1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

References: MDEV-4572 - merge with lp:codership-mysql/5.5-23 revisions 3858..3867

This commit is contained in:
Seppo Jaakola
2013-05-25 12:22:57 +03:00
parent 48af4be62a
commit 9d1546fe2c
14 changed files with 45 additions and 27 deletions

View File

@ -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 }'";