diff options
| author | Martin Schwenke <martin@meltin.net> | 2014-12-19 14:19:32 +1100 |
|---|---|---|
| committer | Michael Adam <obnox@samba.org> | 2015-01-09 02:03:40 +0100 |
| commit | 4638010abb116aed0c180207aaa11475277aecb7 (patch) | |
| tree | f070d74f5a3f6c4c5886415172d570f072bacfe5 /ctdb/tests/scripts | |
| parent | a5c5eee7d186d938c5b458cb6dbf0c78cb548b63 (diff) | |
| download | samba-4638010abb116aed0c180207aaa11475277aecb7.tar.gz samba-4638010abb116aed0c180207aaa11475277aecb7.tar.xz samba-4638010abb116aed0c180207aaa11475277aecb7.zip | |
ctdb-scripts: Don't use the GNU awk gensub() function
This is a gawk extension and can't be used reliably if just running
"awk". It is simple enough to switch to using the standard sub() and
gsub() functions.
The alternative is to switch to explicitly running "gawk". However,
although the eventscripts aren't exactly portable, it is probably
better to move closer to portability than further away.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'ctdb/tests/scripts')
| -rw-r--r-- | ctdb/tests/scripts/integration.bash | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ctdb/tests/scripts/integration.bash b/ctdb/tests/scripts/integration.bash index 0d27c93643..139a9a23cb 100644 --- a/ctdb/tests/scripts/integration.bash +++ b/ctdb/tests/scripts/integration.bash @@ -699,8 +699,9 @@ ip_maskbits_iface () ip addr show to "${_addr}/${_bits}" 2>/dev/null | \ awk -v family="${_family}" \ - 'NR == 1 { iface = gensub(":$", "", 1, $2) } \ - $1 ~ /inet/ { print gensub(".*/", "", 1, $2), iface, family }' + 'NR == 1 { iface = $2; sub(":$", "", iface) } \ + $1 ~ /inet/ { mask = $2; sub(".*/", "", mask); \ + print mask, iface, family }' } drop_ip () |
