diff options
author | Miloslav Trmac <mitr@volny.cz> | 2006-03-19 14:55:41 +0000 |
---|---|---|
committer | Miloslav Trmac <mitr@volny.cz> | 2006-03-19 14:55:41 +0000 |
commit | 0a0bb655b2041c0978c768586c2f1057b80e816c (patch) | |
tree | b6f7d62c21e5f554546bf93db78acfd37a2382e6 /rc.d/init.d/network | |
parent | 11dd31df207ec365db599d8201e140ee663ef398 (diff) | |
download | initscripts-0a0bb655b2041c0978c768586c2f1057b80e816c.tar initscripts-0a0bb655b2041c0978c768586c2f1057b80e816c.tar.gz initscripts-0a0bb655b2041c0978c768586c2f1057b80e816c.tar.bz2 initscripts-0a0bb655b2041c0978c768586c2f1057b80e816c.tar.xz initscripts-0a0bb655b2041c0978c768586c2f1057b80e816c.zip |
Minor cleanups (#173574):
- Don't duplicate unset
- Remove two (eval `grep ...`) instances
Diffstat (limited to 'rc.d/init.d/network')
-rwxr-xr-x | rc.d/init.d/network | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/rc.d/init.d/network b/rc.d/init.d/network index 943b7798..cf0fa00a 100755 --- a/rc.d/init.d/network +++ b/rc.d/init.d/network @@ -94,6 +94,7 @@ case "$1" in # bring up all other interfaces configured to come up at boot time for i in $interfaces; do + unset DEVICE TYPE SLAVE BRIDGE eval $(LANG=C fgrep "DEVICE=" ifcfg-$i) eval $(LANG=C fgrep "TYPE=" ifcfg-$i) eval $(LANG=C fgrep "SLAVE=" ifcfg-$i) @@ -103,34 +104,28 @@ case "$1" in if [ "${DEVICE##cipcb}" != "$DEVICE" ] ; then cipeinterfaces="$cipeinterfaces $i" - unset DEVICE TYPE SLAVE BRIDGE continue fi if [ "$TYPE" = "xDSL" ]; then xdslinterfaces="$xdslinterfaces $i" - unset DEVICE TYPE SLAVE BRIDGE continue fi if [ -n "$BRIDGE" ]; then is_available $i bridgeinterfaces="$bridgeinterfaces $i" - unset DEVICE TYPE SLAVE BRIDGE continue fi if [ "${DEVICE%%.*}" != "$DEVICE" ] ; then vlaninterfaces="$vlaninterfaces $i" - unset DEVICE TYPE SLAVE BRIDGE continue fi if [ "$SLAVE" = "yes" ]; then - unset DEVICE TYPE SLAVE BRIDGE continue fi - unset DEVICE TYPE SLAVE BRIDGE - + if LANG=C egrep -L "^ONBOOT=['\"]?[Nn][Oo]['\"]?" ifcfg-$i > /dev/null ; then # this loads the module, to preserve ordering is_available $i @@ -202,6 +197,7 @@ case "$1" in # get list of bonding, cipe, and xdsl interfaces for i in $interfaces; do + unset DEVICE TYPE BRIDGE eval $(LANG=C fgrep "DEVICE=" ifcfg-$i) eval $(LANG=C fgrep "TYPE=" ifcfg-$i) eval $(LANG=C fgrep "BRIDGE=" ifcfg-$i) @@ -210,47 +206,34 @@ case "$1" in if [ "${DEVICE##cipcb}" != "$DEVICE" ] ; then cipeinterfaces="$cipeinterfaces $i" - unset DEVICE TYPE BRIDGE continue fi if [ -n "$BRIDGE" ]; then bridgeinterfaces="$bridgeinterfaces $i" - unset DEVICE TYPE BRIDGE continue fi if [ "$TYPE" = "xDSL" ]; then xdslinterfaces="$xdslinterfaces $i" - unset DEVICE TYPE BRIDGE continue fi if [ "${DEVICE%%.*}" != "$DEVICE" ] ; then vlaninterfaces="$vlaninterfaces $i" - unset DEVICE TYPE SLAVE BRIDGE continue fi remaining="$remaining $i" - unset DEVICE TYPE BRIDGE done - for i in $cipeinterfaces $xdslinterfaces $bridgeinterfaces $vlaninterfaces; do - eval $(fgrep "DEVICE=" ifcfg-$i) + for i in $cipeinterfaces $xdslinterfaces $bridgeinterfaces $vlaninterfaces $remaining; do + (. ifcfg-$i if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi if ! check_device_down $DEVICE; then action $"Shutting down interface $i: " ./ifdown $i boot fi + ) done - - # shut down all interfaces (other than loopback) - for i in $remaining ; do - eval $(fgrep "DEVICE=" ifcfg-$i) - if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi - if ! check_device_down $DEVICE; then - action $"Shutting down interface $i: " ./ifdown $i boot - fi - done case "$IPX" in yes|true) if [ "$IPXINTERNALNETNUM" != "0" ]; then |