diff options
author | Roy Marples <roy@marples.name> | 2008-03-11 00:04:49 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2008-03-11 00:04:49 +0000 |
commit | 656b79b51e0f0a0c26e73b8b7c61e7cca8cbb600 (patch) | |
tree | 0b3880c2ad8c118e19841af0ad673f9a9ecc07c3 /net.BSD | |
parent | 8b23aaecff11723184bc4761bef68ed98a3ad7af (diff) |
Fix getting MAC address on NetBSD.
Diffstat (limited to 'net.BSD')
-rw-r--r-- | net.BSD/ifconfig.sh | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/net.BSD/ifconfig.sh b/net.BSD/ifconfig.sh index d56ba259..6f961776 100644 --- a/net.BSD/ifconfig.sh +++ b/net.BSD/ifconfig.sh @@ -18,24 +18,6 @@ _exists() fi } -_get_mac_address() -{ - local proto= address= foo= - LC_ALL=C ifconfig "${IFACE}" | while read proto address foo; do - case "${proto}" in - ether) - case "${address}" in - 00:00:00:00:00:00);; - 44:44:44:44:44:44);; - FF:FF:FF:FF:FF:FF);; - *) echo "${address}";; - esac - return 0 - ;; - esac - done -} - _up() { ifconfig "${IFACE}" up @@ -79,11 +61,30 @@ _ifconfig_ent() { LC_ALL=C ifconfig "${IFACE}" 2>/dev/null | while read ent rest; do case "${ent}" in - "$1") echo "${rest}";; + $1) echo "${rest}";; esac done } +_get_mac_address() +{ + local ent="ether" + case "${RC_UNAME}" in + NetBSD|OpenBSD) ent="address:";; + esac + + case $(_ifconfig_ent "${ent}") in + 00:00:00:00:00:00);; + 44:44:44:44:44:44);; + FF:FF:FF:FF:FF:FF);; + "") return 1;; + *) echo "${address}";; + esac + + return 0; +} + + _is_wireless() { case "$(_ifconfig_ent "media:")" in |