aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig
diff options
context:
space:
mode:
authorFlorian La Roche <laroche@redhat.com>2002-07-10 10:14:28 +0000
committerFlorian La Roche <laroche@redhat.com>2002-07-10 10:14:28 +0000
commitd5f7fbcf3f34a7fdf352584b53691c6f592808a5 (patch)
treeb0b9964a7dc96ae27fcb91aa1c0b34b8e0311e4c /sysconfig
parent16283434db1d8b6fe03e613b321fc42bfabe80a9 (diff)
downloadinitscripts-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
Diffstat (limited to 'sysconfig')
-rw-r--r--sysconfig/network-scripts/network-functions17
1 files changed, 6 insertions, 11 deletions
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
}