bug 7790: do not set default route in some cases

This commit is contained in:
Chiradeep Vittal 2010-12-30 18:25:34 -08:00
parent 7919c7f938
commit c9c08a3ff8

View File

@ -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
}