diff options
author | Bill Nottingham <notting@redhat.com> | 2006-08-01 17:37:16 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2006-08-01 17:37:16 +0000 |
commit | a03d315834a5a688bf35fecad1a19f1b61634641 (patch) | |
tree | 3d4a06026849a636bd601a29316e11145e62b81b /sysconfig/network-scripts | |
parent | 1cedb2c5ff5e4bb4372de3fc81a1737559cf1915 (diff) | |
download | initscripts-a03d315834a5a688bf35fecad1a19f1b61634641.tar initscripts-a03d315834a5a688bf35fecad1a19f1b61634641.tar.gz initscripts-a03d315834a5a688bf35fecad1a19f1b61634641.tar.bz2 initscripts-a03d315834a5a688bf35fecad1a19f1b61634641.tar.xz initscripts-a03d315834a5a688bf35fecad1a19f1b61634641.zip |
make test for bonding device a function
Diffstat (limited to 'sysconfig/network-scripts')
-rwxr-xr-x | sysconfig/network-scripts/ifup-eth | 8 | ||||
-rw-r--r-- | sysconfig/network-scripts/network-functions | 7 |
2 files changed, 10 insertions, 5 deletions
diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth index cbea96a2..2cf5d6d1 100755 --- a/sysconfig/network-scripts/ifup-eth +++ b/sysconfig/network-scripts/ifup-eth @@ -114,9 +114,7 @@ fi # Bonding initialization. For DHCP, we need to enslave the devices early, # so it can actually get an IP. -if [ "$ISALIAS" = no ] && \ - { [ "${TYPE}" = "Bonding" ] \ - || ethtool -i $DEVICE 2>/dev/null | grep -q "driver: bonding"; } then +if [ "$ISALIAS" = no ] && is_bonding_device ${DEVICE} ; then /sbin/ip link set dev ${DEVICE} down /sbin/ip link set dev ${DEVICE} up [ -n "${LINKDELAY}" ] && /bin/sleep ${LINKDELAY} @@ -201,7 +199,7 @@ else fi [ -n "${LINKDELAY}" ] && /bin/sleep ${LINKDELAY} # Bonding initialization part II - if [ "${TYPE}" = "Bonding" ] || ethtool -i $DEVICE 2>/dev/null| grep -q "driver: bonding" ; then + if is_bonding_device ${DEVICE} ; then for device in `LANG=C grep -l "^[[:space:]]*MASTER=${DEVICE}" /etc/sysconfig/network-scripts/ifcfg-*` ; do is_ignored_file "$device" && continue /sbin/ifup ${device##*/} @@ -278,7 +276,7 @@ fi # Bonding initialization part II - for static, enslave the devices. For # DHCP, remove any routes for the slaves. -if [ "${TYPE}" = "Bonding" ] || ethtool -i $DEVICE 2>/dev/null| grep -q "driver: bonding" ; then +if is_bonding_device ${DEVICE} ; then for device in `LANG=C grep -l "^[[:space:]]*MASTER=${DEVICE}" /etc/sysconfig/network-scripts/ifcfg-*` ; do is_ignored_file "$device" && continue if [ "$BOOTPROTO" = "dhcp" ]; then diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions index e60d704b..dacf1d22 100644 --- a/sysconfig/network-scripts/network-functions +++ b/sysconfig/network-scripts/network-functions @@ -380,6 +380,13 @@ is_wireless_device () return 1 } +is_bonding_device () +{ + [ "${TYPE}" = "Bonding" ] && return 0 + ethtool -i $1 2>/dev/null | grep -q "driver: bonding" && return 0 + return 1 +} + # Mainframe devices: configure_ccwgroup_device () { |