summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xtests/cidr.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/cidr.sh b/tests/cidr.sh
index ca01f06..abb69b8 100755
--- a/tests/cidr.sh
+++ b/tests/cidr.sh
@@ -46,7 +46,7 @@ if which netmask >/dev/null 2>&1; then
}
elif which ipcalc >/dev/null 2>&1; then
net_first_addr() {
- ipcalc $1 | awk '/^Address:/{print $2}'
+ ipcalc $1 | awk '/^(Address|HostMin):/{print $2; exit}'
}
net_last_addr() {
# Netmask tool prints broadcast address as last one, so
@@ -54,6 +54,7 @@ elif which ipcalc >/dev/null 2>&1; then
# being recognized as special by ipcalc.
ipcalc $1 | awk '/^(Hostroute|HostMax):/{out=$2}
/^Broadcast:/{out=$2}
+ /^Address:/{out=$2}
END{print out}'
}
else