summaryrefslogtreecommitdiffstats
path: root/sysconfig
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2008-07-10 09:19:06 -0400
committerBill Nottingham <notting@redhat.com>2008-07-10 09:19:06 -0400
commite26763164393558b9ab06176ce7d7afea3cae749 (patch)
tree9cf828bcbe3e2abc187819191605a30f87056122 /sysconfig
parent952ca7a3483c63751239f22cd23f98e4d982d62b (diff)
downloadinitscripts-e26763164393558b9ab06176ce7d7afea3cae749.tar.gz
initscripts-e26763164393558b9ab06176ce7d7afea3cae749.tar.xz
initscripts-e26763164393558b9ab06176ce7d7afea3cae749.zip
Minor cleanups.
Use sysfs to see if the bridge is there, and brctl has had error codes for quite a while now.
Diffstat (limited to 'sysconfig')
-rwxr-xr-xsysconfig/network-scripts/ifup-eth12
1 files changed, 3 insertions, 9 deletions
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