aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2000-06-01 04:31:13 +0000
committerBill Nottingham <notting@redhat.com>2000-06-01 04:31:13 +0000
commit5968db2c52e602ac05ba7165d41eea4615f24850 (patch)
tree46ddd262583395ee3d84baf858cb9b04c138bf67
parentc5aae781c0ea7ce533df999b635ab2dee6ab5cbe (diff)
downloadinitscripts-5968db2c52e602ac05ba7165d41eea4615f24850.tar
initscripts-5968db2c52e602ac05ba7165d41eea4615f24850.tar.gz
initscripts-5968db2c52e602ac05ba7165d41eea4615f24850.tar.bz2
initscripts-5968db2c52e602ac05ba7165d41eea4615f24850.tar.xz
initscripts-5968db2c52e602ac05ba7165d41eea4615f24850.zip
don't add duplicate default routes for aliases
-rwxr-xr-xsysconfig/network-scripts/ifup-aliases7
1 files changed, 5 insertions, 2 deletions
diff --git a/sysconfig/network-scripts/ifup-aliases b/sysconfig/network-scripts/ifup-aliases
index f65d5956..239c9775 100755
--- a/sysconfig/network-scripts/ifup-aliases
+++ b/sysconfig/network-scripts/ifup-aliases
@@ -266,8 +266,11 @@ function new_interface ()
if [ "${GATEWAY}" != "" ]; then
if [ "${GATEWAYDEV}" = "" -o "${GATEWAYDEV}" = "${DEVICE}" ]; then
- # set up default gateway
- route add default gw ${GATEWAY} ${DEVICE}
+ # set up default gateway, if it isn't already there
+ CURGW=`route -n | grep ^0\.0\.0\.0 | awk '{ print $2 }'`
+ if [ "$CURGW" != "$GATEWAY" ]; then
+ route add default gw ${GATEWAY} ${DEVICE}
+ fi
fi
fi