From e51c3017ff004dce9585e97a50fb05cdd5caf339 Mon Sep 17 00:00:00 2001 From: "Jose A. Rivera" Date: Thu, 24 Sep 2015 10:07:38 -0700 Subject: [PATCH] ctdb-scripts: Strip out virtual NIC information from iface name. Under lxc, the "ip" tool reports interface names with a formatting of @, but the system still only uses to refer to the interface. Strip the name string to remove anything after and including the "@" sign, should it exist. Signed-off-by: Jose A. Rivera Reviewed-by: Guenther Deschner --- ctdb/config/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctdb/config/functions b/ctdb/config/functions index 49bed98..6480114 100755 --- a/ctdb/config/functions +++ b/ctdb/config/functions @@ -581,7 +581,7 @@ ip_maskbits_iface () ip addr show to "${_addr}/${_bits}" 2>/dev/null | \ awk -v family="${_family}" \ - 'NR == 1 { iface = $2; sub(":$", "", iface) ; \ + 'NR == 1 { iface = $2; sub("(@.*)?:$", "", iface) ; \ sub("@.*", "", iface) } \ $1 ~ /inet/ { mask = $2; sub(".*/", "", mask); \ print mask, iface, family }' -- 2.4.3