aboutsummaryrefslogtreecommitdiff
path: root/net.BSD/ifconfig.sh
diff options
context:
space:
mode:
Diffstat (limited to 'net.BSD/ifconfig.sh')
-rw-r--r--net.BSD/ifconfig.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/net.BSD/ifconfig.sh b/net.BSD/ifconfig.sh
index 2e88bc20..bfc10055 100644
--- a/net.BSD/ifconfig.sh
+++ b/net.BSD/ifconfig.sh
@@ -51,9 +51,10 @@ _is_wireless() {
_get_inet_address() {
set -- $(LC_ALL=C ifconfig "${IFACE}" |
sed -n -e 's/^[[:space:]]*inet \([^ ]*\) netmask 0x\(..\)\(..\)\(..\)\(..\).*/\1 0x\2.0x\3.0x\4/p')
+ [ -z "$1" ] && return 1
+
echo -n "$1"
shift
-
echo "/$(_netmask2cidr "$1")"
}