diff options
author | Mohit Mehta <mohit.mehta@vyatta.com> | 2008-06-26 16:46:56 +0000 |
---|---|---|
committer | Mohit Mehta <mohit.mehta@vyatta.com> | 2008-06-26 16:46:56 +0000 |
commit | f7f94359f2fccaed84b8c73c1ab743450348eb75 (patch) | |
tree | 80ecbf0c5272e603d3b37e17250d8274b11e47ad /templates | |
parent | 2d9868a5b7d97cd493c7035b9057784125f0fe9c (diff) | |
download | vyatta-cfg-system-f7f94359f2fccaed84b8c73c1ab743450348eb75.tar.gz vyatta-cfg-system-f7f94359f2fccaed84b8c73c1ab743450348eb75.zip |
=> Modified vyatta_update_resolv.pl to update (i.e. add and remove) 'name-server' and 'domain-name-server' options
in /etc/resolv.conf received by a dhcp client for an interface
=> Modified name-server/node.def so as to have the name-server set by our CLI on the top of
/etc/resolv.conf to take priority over name-servers received from dhcp client
Diffstat (limited to 'templates')
-rw-r--r-- | templates/system/name-server/node.def | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/templates/system/name-server/node.def b/templates/system/name-server/node.def index 0ed43351..3866e82c 100644 --- a/templates/system/name-server/node.def +++ b/templates/system/name-server/node.def @@ -5,7 +5,9 @@ update:expression: "sudo sh -c \"touch /etc/resolv.conf && \ if grep -q '$VAR(@)' /etc/resolv.conf; then \ exit 0; \ else \ - echo \\\"nameserver\t $VAR(@)\\\" >> /etc/resolv.conf; \ + mv -f /etc/resolv.conf /etc/old_resolv.conf && \ + echo \\\"nameserver\t $VAR(@)\\\" >> /etc/resolv.conf && \ + cat /etc/old_resolv.conf >> /etc/resolv.conf; \ fi && \ if [ -f /etc/ntp.conf ] && grep -q 'server' /etc/ntp.conf; then \ /usr/sbin/invoke-rc.d ntp restart >&/dev/null; \ |