CLOUDSTACK-4132 current dnsmasq config does not allow guest virtual machines(clients) to update its hostnames with a DNS server

Introducing the option dhcp-client-update fails if the dnsmasq version is less than 2.6 (like in older templates).
Added a check for the version in cloud-early-config. will add dhcp-client-update option in the config file only
if the dnsmasq version is 2.6 and above.

Signed-off-by: Jayapal <jayapal@apache.org>
This commit is contained in:
Bharat Kumar 2013-08-17 10:58:23 +05:30 committed by Jayapal
parent 921f783a86
commit 66d7615065
1 changed files with 9 additions and 0 deletions

View File

@ -724,6 +724,15 @@ setup_dnsmasq() {
then
echo "$ETH0_IP6 data-server" >> /etc/hosts
fi
#add the dhcp-client-update only if dnsmasq version is 2.6 and above
dnsmasqVersion=$(dnsmasq -v | grep version -m 1 | grep -o "[[:digit:]]\.[[:digit:]]")
major=$(echo "$dnsmasqVersion" | cut -d '.' -f 1)
minor=$(echo "$dnsmasqVersion" | cut -d '.' -f 2)
if [ "$major" -eq '2' -a "$minor" -ge '6' ] || [ "$major" -gt '2' ]
then
sed -i -e "/^dhcp-client-update/d" /etc/dnsmasq.conf
echo 'dhcp-client-update' >> /etc/dnsmasq.conf
fi
}
setup_sshd(){