diff options
8 files changed, 43 insertions, 1 deletions
diff --git a/scripts/dynamic-dns/vyatta-dynamic-dns.pl b/scripts/dynamic-dns/vyatta-dynamic-dns.pl index 83206253..e8aedae8 100755 --- a/scripts/dynamic-dns/vyatta-dynamic-dns.pl +++ b/scripts/dynamic-dns/vyatta-dynamic-dns.pl @@ -136,6 +136,24 @@ sub dynamicdns_get_values { } } + my @rfc2136s = $config->listNodes("rfc2136"); + foreach my $rfc2136 (@rfc2136s) { + $config->setLevel("service dns dynamic interface $interface rfc2136 $rfc2136"); + my $key_file = $config->returnValue("key"); + my @records = $config->returnValues("record"); + my $nsserver = $config->returnValue("server"); + my $ttl = $config->returnValue("ttl"); + my $zone = $config->returnValue("zone"); + + foreach my $record (@records) { + $output .= "server=$server\n"; + $output .= "protocol=nsupdate\n"; + $output .= "password=$key_file\n"; + $output .= "ttl=$ttl\n"; + $output .= "zone=$zone\n"; + $output .= "$record\n\n"; + } + } return $output; } diff --git a/templates/service/dns/dynamic/interface/node.def b/templates/service/dns/dynamic/interface/node.def index 1610cc64..c6cc6782 100644 --- a/templates/service/dns/dynamic/interface/node.def +++ b/templates/service/dns/dynamic/interface/node.def @@ -2,7 +2,7 @@ tag: help: Interface to send DDNS updates for [REQUIRED] type: txt allowed: /opt/vyatta/sbin/vyatta-interfaces.pl --show=all -commit:expression: $VAR(./@/service/@@) != ""; "At least one service must be set to send DDNS updates for $VAR(@)" +commit:expression: $VAR(./@/service/@@) != "" || $VAR(./@/rfc2136/@@) != ""; "At least one service must be set to send DDNS updates for $VAR(@)" commit:expression: exec "/opt/vyatta/sbin/vyatta-interfaces.pl --dev=$VAR(@) --warn" delete:touch /tmp/ddclient_$VAR(@).$PPID diff --git a/templates/service/dns/dynamic/interface/node.tag/rfc2136/node.def b/templates/service/dns/dynamic/interface/node.tag/rfc2136/node.def new file mode 100644 index 00000000..7da9e2ea --- /dev/null +++ b/templates/service/dns/dynamic/interface/node.tag/rfc2136/node.def @@ -0,0 +1,8 @@ +tag: +help: RFC2136 Update name +type: txt + +commit:expression: $VAR(./@/zone) != ""; "Set zone for service $VAR(./@) to send DDNS updates for interface $VAR(../@)" +commit:expression: $VAR(./@/key) != ""; "Set key for service $VAR(./@) to send DDNS updates for interface $VAR(../@)" +commit:expression: $VAR(./@/record) != ""; "Set record for service $VAR(./@) to send DDNS updates for interface $VAR(../@)" +commit:expression: $VAR(./@/server) != ""; "Set server for service $VAR(./@) to send DDNS updates for interface $VAR(../@)" diff --git a/templates/service/dns/dynamic/interface/node.tag/rfc2136/node.tag/key/node.def b/templates/service/dns/dynamic/interface/node.tag/rfc2136/node.tag/key/node.def new file mode 100644 index 00000000..0519591d --- /dev/null +++ b/templates/service/dns/dynamic/interface/node.tag/rfc2136/node.tag/key/node.def @@ -0,0 +1,4 @@ +type: txt +help: File containing the secret key shared with remote DNS server [REQUIRED] +syntax:expression: exec "/opt/vyatta/sbin/check_file_in_config_dir $VAR(@) '/config/auth'" +val_help: File in /config/auth diff --git a/templates/service/dns/dynamic/interface/node.tag/rfc2136/node.tag/record/node.def b/templates/service/dns/dynamic/interface/node.tag/rfc2136/node.tag/record/node.def new file mode 100644 index 00000000..11051296 --- /dev/null +++ b/templates/service/dns/dynamic/interface/node.tag/rfc2136/node.tag/record/node.def @@ -0,0 +1,3 @@ +multi: +help: Record to be updated [REQUIRED] +type: txt diff --git a/templates/service/dns/dynamic/interface/node.tag/rfc2136/node.tag/server/node.def b/templates/service/dns/dynamic/interface/node.tag/rfc2136/node.tag/server/node.def new file mode 100644 index 00000000..7bc5b0cb --- /dev/null +++ b/templates/service/dns/dynamic/interface/node.tag/rfc2136/node.tag/server/node.def @@ -0,0 +1,2 @@ +help: Server to be updated [REQUIRED] +type: txt diff --git a/templates/service/dns/dynamic/interface/node.tag/rfc2136/node.tag/ttl/node.def b/templates/service/dns/dynamic/interface/node.tag/rfc2136/node.tag/ttl/node.def new file mode 100644 index 00000000..9483750c --- /dev/null +++ b/templates/service/dns/dynamic/interface/node.tag/rfc2136/node.tag/ttl/node.def @@ -0,0 +1,5 @@ +type: u32 + +help: Time To Live + +default: 600 diff --git a/templates/service/dns/dynamic/interface/node.tag/rfc2136/node.tag/zone/node.def b/templates/service/dns/dynamic/interface/node.tag/rfc2136/node.tag/zone/node.def new file mode 100644 index 00000000..cc42bcf3 --- /dev/null +++ b/templates/service/dns/dynamic/interface/node.tag/rfc2136/node.tag/zone/node.def @@ -0,0 +1,2 @@ +help: Zone to be updated [REQUIRED] +type: txt |