Fix getting MAC address on NetBSD.

This commit is contained in:
Roy Marples 2008-03-11 00:04:49 +00:00
parent 8b23aaecff
commit 656b79b51e

View File

@ -18,24 +18,6 @@ _exists()
fi 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() _up()
{ {
ifconfig "${IFACE}" up ifconfig "${IFACE}" up
@ -79,11 +61,30 @@ _ifconfig_ent()
{ {
LC_ALL=C ifconfig "${IFACE}" 2>/dev/null | while read ent rest; do LC_ALL=C ifconfig "${IFACE}" 2>/dev/null | while read ent rest; do
case "${ent}" in case "${ent}" in
"$1") echo "${rest}";; $1) echo "${rest}";;
esac esac
done 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() _is_wireless()
{ {
case "$(_ifconfig_ent "media:")" in case "$(_ifconfig_ent "media:")" in