summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-03-11 00:04:49 +0000
committerRoy Marples <roy@marples.name>2008-03-11 00:04:49 +0000
commit656b79b51e0f0a0c26e73b8b7c61e7cca8cbb600 (patch)
tree0b3880c2ad8c118e19841af0ad673f9a9ecc07c3
parent8b23aaecff11723184bc4761bef68ed98a3ad7af (diff)
downloadopenrc-656b79b51e0f0a0c26e73b8b7c61e7cca8cbb600.tar.gz
openrc-656b79b51e0f0a0c26e73b8b7c61e7cca8cbb600.tar.bz2
openrc-656b79b51e0f0a0c26e73b8b7c61e7cca8cbb600.tar.xz
Fix getting MAC address on NetBSD.
-rw-r--r--net.BSD/ifconfig.sh39
1 files changed, 20 insertions, 19 deletions
diff --git a/net.BSD/ifconfig.sh b/net.BSD/ifconfig.sh
index d56ba25..6f96177 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