Updated Branches: refs/heads/4.2 ffbc30ddb -> 34582d672 refs/heads/master 6c6217594 -> baf681c16
CLOUDSTACK-3533 Fixed dhcphosts.txt for two entries and also dhcp_relase for ipv6 Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/baf681c1 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/baf681c1 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/baf681c1 Branch: refs/heads/master Commit: baf681c16db76a0733215832ae77b2488e1643ad Parents: 6c62175 Author: Jayapal <[email protected]> Authored: Mon Jul 15 20:02:31 2013 +0530 Committer: Jayapal <[email protected]> Committed: Mon Jul 15 20:02:31 2013 +0530 ---------------------------------------------------------------------- patches/systemvm/debian/config/root/edithosts.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/baf681c1/patches/systemvm/debian/config/root/edithosts.sh ---------------------------------------------------------------------- diff --git a/patches/systemvm/debian/config/root/edithosts.sh b/patches/systemvm/debian/config/root/edithosts.sh index 2d99586..817d726 100755 --- a/patches/systemvm/debian/config/root/edithosts.sh +++ b/patches/systemvm/debian/config/root/edithosts.sh @@ -96,11 +96,18 @@ wait_for_dnsmasq () { return 1 } -if [ "$ipv4" != '' -a $no_dhcp_release -eq 0 ] +if [ $ipv4 ] +then + ip=$ipv4 +else + ip=$ipv6 +fi + +if [ $no_dhcp_release -eq 0 ] then #release previous dhcp lease if present logger -t cloud "edithosts: releasing $ipv4" - dhcp_release eth0 $ipv4 $(grep $ipv4 $DHCP_LEASES | awk '{print $2}') > /dev/null 2>&1 + dhcp_release eth0 $ip $(grep $ip $DHCP_LEASES | awk '{print $2}') > /dev/null 2>&1 logger -t cloud "edithosts: released $ipv4" fi @@ -118,7 +125,8 @@ then fi if [ $ipv6 ] then - sed -i /$ipv6,/d $DHCP_HOSTS + #searching with [$ipv6], matching other ip so using $ipv6], + sed -i /$ipv6],/d $DHCP_HOSTS fi # don't want to do this in the future, we can have same VM with multiple nics/entries #sed -i /$host,/d $DHCP_HOSTS
