summaryrefslogtreecommitdiff
path: root/scripts/vyos-update-nhrp.pl
diff options
context:
space:
mode:
authorKim Hagen <khagen@multi-development.com>2014-09-04 14:33:41 +0200
committerKim Hagen <khagen@multi-development.com>2014-09-04 14:33:41 +0200
commit5ec8a7e350286d6a818c742e2bea73bfbe0ca149 (patch)
tree340d499601f348d7f28590e1d9476a5c19cee551 /scripts/vyos-update-nhrp.pl
parent379098c4c340b5bea669c768e6e882ece3438683 (diff)
downloadvyos-nhrp-5ec8a7e350286d6a818c742e2bea73bfbe0ca149.tar.gz
vyos-nhrp-5ec8a7e350286d6a818c742e2bea73bfbe0ca149.zip
Allow multiple map and dynamic-map in config file
Diffstat (limited to 'scripts/vyos-update-nhrp.pl')
-rw-r--r--scripts/vyos-update-nhrp.pl28
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");