From 62c18e56f77bd8c44a3e214817067f5dd752ff01 Mon Sep 17 00:00:00 2001 From: Alex Harpin Date: Sat, 7 Mar 2015 16:30:40 +0000 Subject: vyatta-cfg-system: add additional services and check for protocols Add the additional services that are supported by ddclient to the list of service defaults. Also add a function to use this list to check for the allowed protocols, and update the protocol node to use this. Bug #507 http://bugzilla.vyos.net/show_bug.cgi?id=507 --- scripts/dynamic-dns/vyatta-dynamic-dns.pl | 37 ++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/dynamic-dns/vyatta-dynamic-dns.pl b/scripts/dynamic-dns/vyatta-dynamic-dns.pl index de66c8ed..283c8159 100755 --- a/scripts/dynamic-dns/vyatta-dynamic-dns.pl +++ b/scripts/dynamic-dns/vyatta-dynamic-dns.pl @@ -40,36 +40,42 @@ my $ddclient_config_dir = '/etc/ddclient'; # my %_services_defaults = ( - dyndns => { - protocol => "dyndns2", - }, afraid => { protocol => "freedns" }, + changeip => { + protocol => "changeip" + }, + cloudflare => { + protocol => "cloudflare" + }, dnspark => { protocol => "dnspark" }, dslreports => { protocol => "dslreports1" }, + dyndns => { + protocol => "dyndns2" + }, easydns => { protocol => "easydns" }, namecheap => { protocol => "namecheap" }, - zoneedit => { - protocol => "zoneedit1" - }, - changeip => { - protocol => "changeip" - }, noip => { protocol => "noip" + }, + sitelutions => { + protocol => "sitelutions" + }, + zoneedit => { + protocol => "zoneedit1" } ); -my ($update_dynamicdns, $op_mode_update_dynamicdns, $stop_dynamicdns, $interface, $get_services, $get_default_services, $check_nodes); +my ($update_dynamicdns, $op_mode_update_dynamicdns, $stop_dynamicdns, $interface, $get_services, $get_default_services, $get_protocols, $check_nodes); GetOptions( "update-dynamicdns!" => \$update_dynamicdns, @@ -78,6 +84,7 @@ GetOptions( "interface=s" => \$interface, "get-services!" => \$get_services, "get-default-services!" => \$get_default_services, + "get-protocols!" => \$get_protocols, "check-nodes!" => \$check_nodes ); @@ -94,7 +101,7 @@ dynamicdns_stop() if (defined $stop_dynamicdns); dynamicdns_get_services() if (defined $get_services); dynamicdns_get_default_services() if (defined $get_default_services); - +dynamicdns_get_protocols() if (defined $get_protocols); dynamicdns_check_nodes() if (defined $check_nodes); exit 0; @@ -166,6 +173,14 @@ sub dynamicdns_get_default_services { print "\n"; } +# Return a list of supported protocols +sub dynamicdns_get_protocols { + for my $service (keys %_services_defaults) { + print " $_services_defaults{$service}{'protocol'}"; + } + print "\n"; +} + # Will return a string with default services and set services, useful for CLI completion sub dynamicdns_get_services { my @o_services = keys %_services_defaults; -- cgit v1.2.3