Cloudstack-3882 remove duplicate entres of dataserver from /etc/hosts

Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
This commit is contained in:
Bharat Kumar 2013-07-28 10:31:26 +05:30 committed by Abhinandan Prateek
parent a8387568f3
commit 62d84d119a
1 changed files with 2 additions and 0 deletions

View File

@ -714,6 +714,8 @@ setup_dnsmasq() {
[ $ETH0_IP ] && echo "dhcp-option=6,$NS" >> /etc/dnsmasq.conf
[ $ETH0_IP6 ] && echo "dhcp-option=option6:dns-server,$NS6" >> /etc/dnsmasq.conf
#adding the name data-server to the /etc/hosts for allowing the access to user-data service and ssh-key reset in every subnet.
//removing the existing entires to avoid duplicates on restarts.
sed -i '/data-server/d' /etc/hosts
if [ -n "$ETH0_IP" ]
then
echo "$ETH0_IP data-server" >> /etc/hosts