From fe08c6b8586e63e9b441c73da1e9f712849e251e Mon Sep 17 00:00:00 2001 From: Mohit Mehta Date: Tue, 5 Aug 2008 16:35:44 +0000 Subject: change DNS forwarding CLI from 'service dns-forwarding' to 'service dns forward' --- scripts/dns-forwarding/vyatta-dns-forwarding.pl | 2 +- templates/service/dns-forwarding/cache-size/node.def | 4 ---- .../service/dns-forwarding/ignore-interface/node.def | 19 ------------------- templates/service/dns-forwarding/node.def | 10 ---------- templates/service/dns/forward/cache-size/node.def | 4 ++++ .../service/dns/forward/ignore-interface/node.def | 19 +++++++++++++++++++ templates/service/dns/forward/node.def | 10 ++++++++++ templates/service/dns/node.def | 1 + .../system/static-host-mapping/host-name/node.def | 4 ++-- 9 files changed, 37 insertions(+), 36 deletions(-) delete mode 100644 templates/service/dns-forwarding/cache-size/node.def delete mode 100644 templates/service/dns-forwarding/ignore-interface/node.def delete mode 100644 templates/service/dns-forwarding/node.def create mode 100644 templates/service/dns/forward/cache-size/node.def create mode 100644 templates/service/dns/forward/ignore-interface/node.def create mode 100644 templates/service/dns/forward/node.def create mode 100644 templates/service/dns/node.def diff --git a/scripts/dns-forwarding/vyatta-dns-forwarding.pl b/scripts/dns-forwarding/vyatta-dns-forwarding.pl index 1fb2282a..672ec04b 100644 --- a/scripts/dns-forwarding/vyatta-dns-forwarding.pl +++ b/scripts/dns-forwarding/vyatta-dns-forwarding.pl @@ -61,7 +61,7 @@ sub dnsforwarding_get_values { my $output = ''; my $config = new VyattaConfig; - $config->setLevel("service dns-forwarding"); + $config->setLevel("service dns forward"); my @ignore_interfaces = $config->returnValues("ignore-interface"); if ($#ignore_interfaces >= 0) { diff --git a/templates/service/dns-forwarding/cache-size/node.def b/templates/service/dns-forwarding/cache-size/node.def deleted file mode 100644 index 3a73f308..00000000 --- a/templates/service/dns-forwarding/cache-size/node.def +++ /dev/null @@ -1,4 +0,0 @@ -type: u32 -default:150 -help: Set DNS forwarding cache size -syntax:expression: ($VAR(@) >=0 && $VAR(@) < 10001) ; "Cache size must be between 0 and 10000" diff --git a/templates/service/dns-forwarding/ignore-interface/node.def b/templates/service/dns-forwarding/ignore-interface/node.def deleted file mode 100644 index 5355eecf..00000000 --- a/templates/service/dns-forwarding/ignore-interface/node.def +++ /dev/null @@ -1,19 +0,0 @@ -multi: -type: txt -help: Set interface to ignore DNS queries on -syntax:expression: exec " - intf_array=($(awk '$1 ~ /:$/ { print $1 }' /proc/net/dev)) - intf_array_len=${#intf_array[*]} - i=0 - while [ $i -lt $intf_array_len ]; do - if [ \"${intf_array[$i]}\" == \"$VAR(@):\" ] ; then - exit 0 - fi - let i++ - done - echo Invalid ethernet interface [$VAR(@)] - exit 1 " - -allowed: local -a array ; - array=($(awk '$1 ~ /:$/ { print $1 }' /proc/net/dev)); - echo -n ${array[@]%:} diff --git a/templates/service/dns-forwarding/node.def b/templates/service/dns-forwarding/node.def deleted file mode 100644 index f84e4f02..00000000 --- a/templates/service/dns-forwarding/node.def +++ /dev/null @@ -1,10 +0,0 @@ -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" -delete:expression: "touch /tmp/dnsmasq.$PPID" -end:expression: "if [ -f \"/tmp/dnsmasq.$PPID\" ]; then \ - sudo /opt/vyatta/sbin/vyatta-dns-forwarding.pl --stop-dnsforwarding \ - rm /tmp/dnsmasq.$PPID; \ - else \ - sudo /opt/vyatta/sbin/vyatta-dns-forwarding.pl --update-dnsforwarding; \ - fi; " diff --git a/templates/service/dns/forward/cache-size/node.def b/templates/service/dns/forward/cache-size/node.def new file mode 100644 index 00000000..3a73f308 --- /dev/null +++ b/templates/service/dns/forward/cache-size/node.def @@ -0,0 +1,4 @@ +type: u32 +default:150 +help: Set DNS forwarding cache size +syntax:expression: ($VAR(@) >=0 && $VAR(@) < 10001) ; "Cache size must be between 0 and 10000" diff --git a/templates/service/dns/forward/ignore-interface/node.def b/templates/service/dns/forward/ignore-interface/node.def new file mode 100644 index 00000000..5355eecf --- /dev/null +++ b/templates/service/dns/forward/ignore-interface/node.def @@ -0,0 +1,19 @@ +multi: +type: txt +help: Set interface to ignore DNS queries on +syntax:expression: exec " + intf_array=($(awk '$1 ~ /:$/ { print $1 }' /proc/net/dev)) + intf_array_len=${#intf_array[*]} + i=0 + while [ $i -lt $intf_array_len ]; do + if [ \"${intf_array[$i]}\" == \"$VAR(@):\" ] ; then + exit 0 + fi + let i++ + done + echo Invalid ethernet interface [$VAR(@)] + exit 1 " + +allowed: local -a array ; + array=($(awk '$1 ~ /:$/ { print $1 }' /proc/net/dev)); + echo -n ${array[@]%:} diff --git a/templates/service/dns/forward/node.def b/templates/service/dns/forward/node.def new file mode 100644 index 00000000..f84e4f02 --- /dev/null +++ b/templates/service/dns/forward/node.def @@ -0,0 +1,10 @@ +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" +delete:expression: "touch /tmp/dnsmasq.$PPID" +end:expression: "if [ -f \"/tmp/dnsmasq.$PPID\" ]; then \ + sudo /opt/vyatta/sbin/vyatta-dns-forwarding.pl --stop-dnsforwarding \ + rm /tmp/dnsmasq.$PPID; \ + else \ + sudo /opt/vyatta/sbin/vyatta-dns-forwarding.pl --update-dnsforwarding; \ + fi; " diff --git a/templates/service/dns/node.def b/templates/service/dns/node.def new file mode 100644 index 00000000..d7040d0d --- /dev/null +++ b/templates/service/dns/node.def @@ -0,0 +1 @@ +help: Configure Domain Name Server (DNS) parameters diff --git a/templates/system/static-host-mapping/host-name/node.def b/templates/system/static-host-mapping/host-name/node.def index 187b21dd..07e6b25b 100644 --- a/templates/system/static-host-mapping/host-name/node.def +++ b/templates/system/static-host-mapping/host-name/node.def @@ -7,10 +7,10 @@ end: sudo sh -c " touch /etc/hosts sed -i '/ $VAR(@) .*#vyatta entry/d' /etc/hosts if [ -z \"$VAR(./inet/@)\" ]; then - if [ -d /opt/vyatta/config/active/service/dns-forwarding ]; then /etc/init.d/dnsmasq restart >&/dev/null; fi + if [ -d /opt/vyatta/config/active/service/dns/forward ]; then /etc/init.d/dnsmasq restart >&/dev/null; fi exit 0 fi declare -a aliases=( $VAR(alias/@@) ) echo -e \"$VAR(inet/@)\\t $VAR(@) \${aliases[*]} \\t #vyatta entry\" >> /etc/hosts - if [ -d /opt/vyatta/config/active/service/dns-forwarding ]; then /etc/init.d/dnsmasq restart >&/dev/null; fi" + if [ -d /opt/vyatta/config/active/service/dns/forward ]; then /etc/init.d/dnsmasq restart >&/dev/null; fi" -- cgit v1.2.3