diff options
Diffstat (limited to 'scripts/vyos-update-nhrp.pl')
-rw-r--r-- | scripts/vyos-update-nhrp.pl | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/scripts/vyos-update-nhrp.pl b/scripts/vyos-update-nhrp.pl index e04503e..b2b6a7e 100644 --- a/scripts/vyos-update-nhrp.pl +++ b/scripts/vyos-update-nhrp.pl @@ -191,29 +191,31 @@ sub tunnel_config { if ( $tunnel_Config->exists("$tunnel_ID map")) { $type = "#spoke"; my @maps = $tunnel_Config->listNodes("$tunnel_ID map"); - my $map = $maps[0]; - push(@conf_file, " map", " $map"); - push(@conf_file, " ", $tunnel_Config->returnValue("$tunnel_ID map $map nbma-address")); shift(@conf_file); unshift(@conf_file, "interface $tunnel_ID $type\n"); + foreach my $map (@maps) { + push(@conf_file, " map", " $map"); + push(@conf_file, " ", $tunnel_Config->returnValue("$tunnel_ID map $map nbma-address")); - if ($tunnel_Config->exists("$tunnel_ID map $map register")) { - push(@conf_file, " register"); - } - if ($tunnel_Config->exists("$tunnel_ID map $map cisco")) { - push(@conf_file, " cisco"); + if ($tunnel_Config->exists("$tunnel_ID map $map register")) { + push(@conf_file, " register"); + } + if ($tunnel_Config->exists("$tunnel_ID map $map cisco")) { + push(@conf_file, " cisco"); + } + push(@conf_file, "\n"); } - push(@conf_file, "\n"); } if ( $tunnel_Config->exists("$tunnel_ID dynamic-map")) { $type = "#spoke"; my @dynmaps = $tunnel_Config->listNodes("$tunnel_ID dynamic-map"); - my $dynmap = $dynmaps[0]; - push(@conf_file, " dynamic-map", " $dynmap"); - push(@conf_file, " ", $tunnel_Config->returnValue("$tunnel_ID dynamic-map $dynmap nbma-domain-name")); shift(@conf_file); unshift(@conf_file, "interface $tunnel_ID $type\n"); - push(@conf_file, "\n"); + foreach my $dynmap (@dynmaps) { + push(@conf_file, " dynamic-map", " $dynmap"); + push(@conf_file, " ", $tunnel_Config->returnValue("$tunnel_ID dynamic-map $dynmap nbma-domain-name")); + push(@conf_file, "\n"); + } } if ( $tunnel_Config->exists("$tunnel_ID shortcut-target")) { my @starget = $tunnel_Config->listNodes("$tunnel_ID shortcut-target"); |