Updated Branches:
  refs/heads/master d5203b19e -> c01d0f74c

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/c01d0f74
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c01d0f74
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c01d0f74

Branch: refs/heads/master
Commit: c01d0f74cd9546d0b2abca55e9021f175959d56b
Parents: d5203b1
Author: Bharat Kumar <[email protected]>
Authored: Wed Aug 14 14:46:50 2013 +0530
Committer: Jayapal <[email protected]>
Committed: Thu Aug 15 10:53:48 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/c01d0f74/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.

Reply via email to