Updated Branches: refs/heads/4.2 85318977c -> 16deb3935
CLOUDSTACK-4317 make the regular expressions in dnsmasq.sh more tighter to avoid matching of ip6dns Signed-off-by: Jayapal <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/16deb393 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/16deb393 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/16deb393 Branch: refs/heads/4.2 Commit: 16deb393522bc02e8835a1dafcd44a62d28f94ea Parents: 8531897 Author: Bharat Kumar <[email protected]> Authored: Wed Aug 14 14:46:50 2013 +0530 Committer: Jayapal <[email protected]> Committed: Thu Aug 15 10:52:38 2013 +0530 ---------------------------------------------------------------------- patches/systemvm/debian/config/root/dnsmasq.sh | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/16deb393/patches/systemvm/debian/config/root/dnsmasq.sh ---------------------------------------------------------------------- diff --git a/patches/systemvm/debian/config/root/dnsmasq.sh b/patches/systemvm/debian/config/root/dnsmasq.sh index c6ab07a..8fae25c 100755 --- a/patches/systemvm/debian/config/root/dnsmasq.sh +++ b/patches/systemvm/debian/config/root/dnsmasq.sh @@ -55,8 +55,8 @@ count=0 # fetching the dns Ips from the command line. -dns1=$(echo "$CMDLINE" | grep -o " dns1=.* " | sed -e 's/dns1=//' | awk '{print $1}') -dns2=$(echo "$CMDLINE" | grep -o " dns2=.* " | sed -e 's/dns2=//' | awk '{print $1}') +dns1=$(echo "$CMDLINE" | grep -o " dns1=[[:digit:]].* " | sed -e 's/dns1=//' | awk '{print $1}') +dns2=$(echo "$CMDLINE" | grep -o " dns2=[[:digit:]].* " | sed -e 's/dns2=//' | awk '{print $1}') dns_servers="${dns1}" if [ -n "$dns2" ] @@ -89,19 +89,18 @@ done #logging the configuration being removed. log="" -log="${log}"`grep "^dhcp-option=6.*" "$DHCP_CONFIG_MAIN"`"\n" -log="${log}"`grep "^dhcp-option=option:router.*" "$DHCP_CONFIG_MAIN"`"\n" -log="${log}"`grep "^dhcp-range=.*" "$DHCP_CONFIG_MAIN"`"\n" -echo -e "$log" > log.dnsmasq.txt +log="${log}"`grep "^dhcp-option=6" "$DHCP_CONFIG_MAIN"`"\n" +log="${log}"`grep "^dhcp-option=option:router" "$DHCP_CONFIG_MAIN"`"\n" +log="${log}"`grep "^dhcp-range=" "$DHCP_CONFIG_MAIN"`"\n" if [ "$log" != '\n\n\n' ] then #Cleaning the existing dhcp confgiuration logger -t cloud "dnsmasq.sh: remvoing the primaryip confg from dnsmasq.conf and adding it to /etc/dnsmaq.d/multiple_ranges.conf" logger -t cloud "dnsmasq.sh: config removed from dnsmasq.conf is $log" - sed -i -e '/dhcp-option=6.*/d' "$DHCP_CONFIG_MAIN" - sed -i -e '/dhcp-option=option:router.*/d' "$DHCP_CONFIG_MAIN" - sed -i -e '/dhcp-range=.*/d' "$DHCP_CONFIG_MAIN" + sed -i -e '/dhcp-option=6/d' "$DHCP_CONFIG_MAIN" + sed -i -e '/dhcp-option=option:router/d' "$DHCP_CONFIG_MAIN" + sed -i -e '/^dhcp-range=/d' "$DHCP_CONFIG_MAIN" fi #wrting the new config into the config file.
