diff options
author | brooks <brooks@FreeBSD.org> | 2006-09-20 19:45:30 +0000 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2006-09-20 19:45:30 +0000 |
commit | 6e1b63c8977158abbdba85b161b81f88960a59bb (patch) | |
tree | 551f931d15bbe3aa2293c7a0760f78984785a835 /etc | |
parent | 81cdbc19d7d89494d0822a05b5e7331310a0ded1 (diff) | |
download | FreeBSD-src-6e1b63c8977158abbdba85b161b81f88960a59bb.zip FreeBSD-src-6e1b63c8977158abbdba85b161b81f88960a59bb.tar.gz |
Search the list of up interfaces provided by "ifconfig -ul" instead of
greping for UP in "ifconfig $ifn". This eliminates a dependancy on
/usr.
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/pccard_ether | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/etc/pccard_ether b/etc/pccard_ether index d2a24fa..355e188 100755 --- a/etc/pccard_ether +++ b/etc/pccard_ether @@ -69,11 +69,13 @@ pccard_ether_start() { ifexists $ifn || exit 1 - if [ -z "$rc_force" -a -x /usr/bin/grep ]; then - if ifconfig $ifn | grep -s '[<,]UP[,>]' > /dev/null 2>&1; then - # Interface is already up, so ignore it. - exit 0 - fi + if [ -z "$rc_force" ]; then + for uif in `ifconfig -ul`; do + if [ "${uif}" = "${ifn}" ]; then + # Interface is already up, so ignore it. + exit 0 + fi + done fi /etc/rc.d/netif start $ifn |