From dc4d53c9eb42a6f9f27f0de762de85ce46b6f788 Mon Sep 17 00:00:00 2001 From: Mohit Mehta Date: Wed, 6 Aug 2008 22:15:10 +0000 Subject: code to specify DNS forwarding nameservers (system, dhcp, explicitly specified) using CLI --- templates/service/dns/forwarding/dhcp/node.def | 9 +++++++++ templates/service/dns/forwarding/name-server/node.def | 3 +++ templates/service/dns/forwarding/node.def | 4 +--- templates/service/dns/forwarding/system/node.def | 2 ++ 4 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 templates/service/dns/forwarding/dhcp/node.def create mode 100644 templates/service/dns/forwarding/name-server/node.def create mode 100644 templates/service/dns/forwarding/system/node.def (limited to 'templates/service') diff --git a/templates/service/dns/forwarding/dhcp/node.def b/templates/service/dns/forwarding/dhcp/node.def new file mode 100644 index 00000000..24598129 --- /dev/null +++ b/templates/service/dns/forwarding/dhcp/node.def @@ -0,0 +1,9 @@ +multi: +type: txt +help: Set to forward DNS queries to nameservers received from DHCP server for specified interface +syntax:expression: exec "/opt/vyatta/sbin/vyatta-dns-forwarding.pl --dhcp-interface $VAR(@)" +commit:expression: exec "/opt/vyatta/sbin/vyatta-dns-forwarding.pl --dhcp-interface-nameserver $VAR(@)" +allowed: + local -a array ; + array=( /var/lib/dhcp3/eth* ) ; + echo -n ${array[@]##*/} diff --git a/templates/service/dns/forwarding/name-server/node.def b/templates/service/dns/forwarding/name-server/node.def new file mode 100644 index 00000000..ad67c6de --- /dev/null +++ b/templates/service/dns/forwarding/name-server/node.def @@ -0,0 +1,3 @@ +multi: +type: ipv4 +help: Set DNS server to forward queries diff --git a/templates/service/dns/forwarding/node.def b/templates/service/dns/forwarding/node.def index f84e4f02..46dbd199 100644 --- a/templates/service/dns/forwarding/node.def +++ b/templates/service/dns/forwarding/node.def @@ -1,6 +1,4 @@ -help: Configure Domain Name Server (DNS) forwarding -syntax:expression: exec "/opt/vyatta/sbin/vyatta-dns-forwarding.pl --nameserver"; "No nameserver exists to forward DNS queries" -create:expression: "/opt/vyatta/sbin/vyatta-dns-forwarding.pl --init-dnsforwarding" +help: Configure DNS forwarding delete:expression: "touch /tmp/dnsmasq.$PPID" end:expression: "if [ -f \"/tmp/dnsmasq.$PPID\" ]; then \ sudo /opt/vyatta/sbin/vyatta-dns-forwarding.pl --stop-dnsforwarding \ diff --git a/templates/service/dns/forwarding/system/node.def b/templates/service/dns/forwarding/system/node.def new file mode 100644 index 00000000..e92a7ad6 --- /dev/null +++ b/templates/service/dns/forwarding/system/node.def @@ -0,0 +1,2 @@ +help: Set DNS forwarding to system nameservers +commit:expression: exec "/opt/vyatta/sbin/vyatta-dns-forwarding.pl --system-nameserver" -- cgit v1.2.3