From e26763164393558b9ab06176ce7d7afea3cae749 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 10 Jul 2008 09:19:06 -0400 Subject: Minor cleanups. Use sysfs to see if the bridge is there, and brctl has had error codes for quite a while now. --- sysconfig/network-scripts/ifup-eth | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'sysconfig') diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth index bf3ab9ea..5c0a46c3 100755 --- a/sysconfig/network-scripts/ifup-eth +++ b/sysconfig/network-scripts/ifup-eth @@ -59,14 +59,8 @@ if [ "${TYPE}" = "Bridge" ]; then echo $"Bridge support not available: brctl not found" exit 1 fi - if ! LC_ALL=C /usr/sbin/brctl show | LC_ALL=C grep -q "^${DEVICE} "; then - /usr/sbin/brctl addbr ${DEVICE} 2>/dev/null - fi - # brctl doesn't report success/failure (BZ #104408) - # Test for ourselves whether it worked. - if ! /usr/sbin/brctl show | LANG=C grep -q "^${DEVICE} " ; then - echo $"Bridge support not available in this kernel" - exit 1 + if [ ! -d /sys/class/net/${DEVICE}/bridge ]; then + /usr/sbin/brctl addbr ${DEVICE} || exit 1 fi [ -n "${DELAY}" ] && /usr/sbin/brctl setfd ${DEVICE} ${DELAY} [ -n "${GCINT}" ] && /usr/sbin/brctl setgcint ${DEVICE} ${GCINT} @@ -87,7 +81,7 @@ is_available ${REALDEVICE} || { is_wireless_device ${DEVICE} && . ./ifup-wireless if [ -n "${BRIDGE}" -a -x /usr/sbin/brctl ]; then - if ! LC_ALL=C /usr/sbin/brctl show | LC_ALL=C grep -q "^${BRIDGE} "; then + if [ ! -d /sys/class/net/${BRIDGE}/bridge ]; then /usr/sbin/brctl addbr ${BRIDGE} 2>/dev/null fi /sbin/ip addr flush dev ${DEVICE} 2>/dev/null -- cgit v1.2.1