diff options
Diffstat (limited to 'rc.d')
-rwxr-xr-x | rc.d/init.d/network | 51 |
1 files changed, 48 insertions, 3 deletions
diff --git a/rc.d/init.d/network b/rc.d/init.d/network index 0c0e2894..612238ce 100755 --- a/rc.d/init.d/network +++ b/rc.d/init.d/network @@ -96,17 +96,29 @@ case "$1" in awk '{ print $3 }' 2>/dev/null` sysctl -w kernel.hotplug="/bin/true" > /dev/null 2>&1 - cipeinterfaces="" + cipeinterfaces="" + bondinterfaces="" + xdslinterfaces="" # bring up all other interfaces configured to come up at boot time for i in $interfaces; do eval $(LANG=C fgrep "DEVICE=" ifcfg-$i) + eval $(LANG=C fgrep "TYPE=" ifcfg-$i) if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi if [ "${DEVICE##cipcb}" != "$DEVICE" ] ; then cipeinterfaces="$cipeinterfaces $DEVICE" continue fi + if [ "${DEVICE##bond}" != "$DEVICE" ] ; then + bondinterfaces="$bondinterfaces $DEVICE" + continue + fi + if [ "$TYPE" = "xDSL" ]; then + xdslinterfaces="$xdslinterfaces $DEVICE" + continue + fi + if LANG=C egrep -L "^ONBOOT=['\"]?[Nn][Oo]['\"]?" ifcfg-$i > /dev/null ; then # this loads the module, to preserve ordering is_available $i @@ -120,8 +132,8 @@ case "$1" in action $"Bringing up interface $i: " ./ifup $i boot done - # Bring up CIPE VPN interfaces - for i in $cipeinterfaces ; do + # Bring up xDSL, CIPE, and bonding interfaces + for i in $xdslinterfaces $cipeinterfaces $bondinterfaces ; do if ! LANG=C egrep -L "^ONBOOT=['\"]?[Nn][Oo]['\"]?" ifcfg-$i >/dev/null 2>&1 ; then # If we're in confirmation mode, get user confirmation. if [ -f /var/run/confirm ]; then @@ -172,6 +184,39 @@ case "$1" in fi fi + cipeinterfaces="" + bondinterfaces="" + xdslinterfaces="" + + # get list of bonding, cipe, and xdsl interfaces + for i in $interfaces; do + eval $(LANG=C fgrep "DEVICE=" ifcfg-$i) + eval $(LANG=C fgrep "TYPE=" ifcfg-$i) + if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi + + if [ "${DEVICE##cipcb}" != "$DEVICE" ] ; then + cipeinterfaces="$cipeinterfaces $DEVICE" + continue + fi + if [ "${DEVICE##bond}" != "$DEVICE" ] ; then + bondinterfaces="$bondinterfaces $DEVICE" + continue + fi + if [ "$TYPE" = "xDSL" ]; then + xdslinterfaces="$xdslinterfaces $DEVICE" + continue + fi + done + + for i in $bondinterfaces $cipeinterfaces $xdslinterfaces ; do + eval $(fgrep "DEVICE=" ifcfg-$i) + if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi + + if ! check_device_down $i; then + action $"Shutting down interface $i: " ./ifdown $i boot + fi + done + # shut down all interfaces (other than loopback) for i in $interfaces ; do eval $(fgrep "DEVICE=" ifcfg-$i) |