diff options
author | Florian La Roche <laroche@redhat.com> | 2002-07-10 10:14:28 +0000 |
---|---|---|
committer | Florian La Roche <laroche@redhat.com> | 2002-07-10 10:14:28 +0000 |
commit | d5f7fbcf3f34a7fdf352584b53691c6f592808a5 (patch) | |
tree | b0b9964a7dc96ae27fcb91aa1c0b34b8e0311e4c | |
parent | 16283434db1d8b6fe03e613b321fc42bfabe80a9 (diff) | |
download | initscripts-d5f7fbcf3f34a7fdf352584b53691c6f592808a5.tar initscripts-d5f7fbcf3f34a7fdf352584b53691c6f592808a5.tar.gz initscripts-d5f7fbcf3f34a7fdf352584b53691c6f592808a5.tar.bz2 initscripts-d5f7fbcf3f34a7fdf352584b53691c6f592808a5.tar.xz initscripts-d5f7fbcf3f34a7fdf352584b53691c6f592808a5.zip |
- do not export GATEWAY in network-functions
- code cleanups
-rw-r--r-- | initscripts.spec | 1 | ||||
-rw-r--r-- | sysconfig/network-scripts/network-functions | 17 |
2 files changed, 7 insertions, 11 deletions
diff --git a/initscripts.spec b/initscripts.spec index dc3b1537..0f5c5b38 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -251,6 +251,7 @@ rm -rf $RPM_BUILD_ROOT - faster check in network-functions:check_default_route() - better checks for backup files - drastically reduce the number of consoletype invocations +- do not export "GATEWAY" in network-functions * Fri Jul 05 2002 Florian La Roche <Florian.LaRoche@redhat.de> - rc.sysinit: do not load raid modules unless /etc/raidtab exists diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions index c54be9a3..f0c4a08d 100644 --- a/sysconfig/network-scripts/network-functions +++ b/sysconfig/network-scripts/network-functions @@ -160,13 +160,11 @@ find_gateway_dev () { . /etc/sysconfig/network if [ -n "${GATEWAY}" -a "${GATEWAY}" != "none" ] ; then - # XXX why? - export GATEWAY dev=`LC_ALL=C /sbin/ip route | \ grep ${GATEWAY} | \ sed -e 's/.* dev \([:alnum:]*\)/\1/'` if [ -n "$dev" ]; then - GATEWAYDEV=$dev + GATEWAYDEV="$dev" fi fi } @@ -176,9 +174,8 @@ add_default_route () . /etc/sysconfig/network check_default_route && return 0 find_gateway_dev - if [ "$GATEWAYDEV" != "" -a \ - "${GATEWAY}" != "" -a \ - "${GATEWAY}" != "none" ] ; then + if [ "$GATEWAYDEV" != "" -a -n "${GATEWAY}" -a \ + "${GATEWAY}" != "none" ]; then if ! check_device_down $1; then if [ "$GATEWAY" = "0.0.0.0" ]; then /sbin/ip route add default dev ${GATEWAYDEV} @@ -186,11 +183,9 @@ add_default_route () /sbin/ip route add default via ${GATEWAY} fi fi - else - if [ -f /etc/default-route ]; then - /sbin/ip route add default via `cat /etc/default-route` - rm -f /etc/default-route - fi + elif [ -f /etc/default-route ]; then + /sbin/ip route add default via `cat /etc/default-route` + rm -f /etc/default-route fi } |