From 5968db2c52e602ac05ba7165d41eea4615f24850 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 1 Jun 2000 04:31:13 +0000 Subject: don't add duplicate default routes for aliases --- sysconfig/network-scripts/ifup-aliases | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sysconfig/network-scripts') 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 -- cgit v1.2.1