From c9c08a3ff841fb3bf29b711a20f996d02965582c Mon Sep 17 00:00:00 2001 From: Chiradeep Vittal Date: Thu, 30 Dec 2010 18:25:34 -0800 Subject: [PATCH] bug 7790: do not set default route in some cases --- .../debian/config/etc/init.d/cloud-early-config | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/patches/systemvm/debian/config/etc/init.d/cloud-early-config b/patches/systemvm/debian/config/etc/init.d/cloud-early-config index 1afa8801045..9e104428179 100755 --- a/patches/systemvm/debian/config/etc/init.d/cloud-early-config +++ b/patches/systemvm/debian/config/etc/init.d/cloud-early-config @@ -243,11 +243,14 @@ setup_dhcpsrvr() { setup_dnsmasq setup_apache2 $ETH0_IP - sed -i -e "/^[#]*dhcp-option=option:router.*$/d" /etc/dnsmasq.conf - echo "dhcp-option=option:router,$GW" >> /etc/dnsmasq.conf - #for now set up ourself as the dns server as well - sed -i -e "/^[#]*dhcp-option=6.*$/d" /etc/dnsmasq.conf - echo "dhcp-option=6,$NS1,$NS2" >> /etc/dnsmasq.conf + if [ "$DEFAULTROUTE" == "true" ] + then + sed -i -e "/^[#]*dhcp-option=option:router.*$/d" /etc/dnsmasq.conf + echo "dhcp-option=option:router,$GW" >> /etc/dnsmasq.conf + #for now set up ourself as the dns server as well + sed -i -e "/^[#]*dhcp-option=6.*$/d" /etc/dnsmasq.conf + echo "dhcp-option=6,$NS1,$NS2" >> /etc/dnsmasq.conf + fi sed -i /gateway/d /etc/hosts echo "$ETH0_IP $NAME" >> /etc/hosts @@ -415,6 +418,9 @@ for i in $CMDLINE type) TYPE=$VALUE ;; + defaultroute) + DEFAULTROUTE=$VALUE + ;; esac done }