ia64/xen-unstable

changeset 19521:9f945f16bd02

network-nat: add domain info for nat-dhcpd

Signed-off-by: Wei Kong <weikong.cn@gmail.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Apr 08 13:18:22 2009 +0100 (2009-04-08)
parents d61d135291f7
children 3929487cdb82
files tools/hotplug/Linux/network-nat
line diff
     1.1 --- a/tools/hotplug/Linux/network-nat	Wed Apr 08 10:18:31 2009 +0100
     1.2 +++ b/tools/hotplug/Linux/network-nat	Wed Apr 08 13:18:22 2009 +0100
     1.3 @@ -48,12 +48,16 @@ then
     1.4    fi
     1.5  fi
     1.6  
     1.7 +domain_name=`cat /etc/resolv.conf | grep -v "#" | grep -E 'search|domain' -i | tail -n 1 | awk '{ print $2 }'`
     1.8 +nameserver=`cat /etc/resolv.conf | grep -v "#" | grep "nameserver" -i -m 1 | awk '{ print $2 }'`
     1.9  
    1.10  function dhcp_start()
    1.11  {
    1.12    if ! grep -q "subnet 10.0.0.0" "$dhcpd_conf_file"
    1.13    then
    1.14 -    echo >>"$dhcpd_conf_file" "subnet 10.0.0.0 netmask 255.255.0.0 {}"
    1.15 +    echo >>"$dhcpd_conf_file" "subnet 10.0.0.0 netmask 255.255.0.0 {\
    1.16 + option domain-name \"$domain_name\";\
    1.17 + option domain-name-servers $nameserver; }"
    1.18    fi
    1.19  
    1.20    "$dhcpd_init_file" restart