diff options
author | Daniil Baturin <daniil@baturin.org> | 2019-08-19 12:00:37 -0400 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2019-08-19 12:00:37 -0400 |
commit | a92341715d0e6f49f00519ed702b200d833498dd (patch) | |
tree | 6107b1ce4680b6127e16549e34ff029e9caa539f | |
parent | aa3d199e2fbb3e59689b63e95be3510fd7c29ec0 (diff) | |
parent | 43ab6976b70ab2247fd9899dcf4507b6b618c7df (diff) | |
download | vyatta-config-mgmt-a92341715d0e6f49f00519ed702b200d833498dd.tar.gz vyatta-config-mgmt-a92341715d0e6f49f00519ed702b200d833498dd.zip |
Merge branch 'current' into equuleus
-rwxr-xr-x | scripts/vyatta-commit-push.pl | 11 | ||||
-rw-r--r-- | templates-cfg/system/config-management/commit-archive/source-address/node.def | 2 |
2 files changed, 11 insertions, 2 deletions
diff --git a/scripts/vyatta-commit-push.pl b/scripts/vyatta-commit-push.pl index 6edfd10..2a1f495 100755 --- a/scripts/vyatta-commit-push.pl +++ b/scripts/vyatta-commit-push.pl @@ -68,6 +68,13 @@ my $hostname = hostname(); $hostname = 'vyos' if ! defined $hostname; my $save_file = "config.boot-$hostname" . $timestamp; +my $source_addr = $config->returnEffectiveValue('source-address'); +my $src_opt = ""; +if( defined($source_addr) ) { + $src_opt = "--interface $source_addr"; + print("Using source address $source_addr\n"); +} + print "Archiving config...\n"; foreach my $uri (@uris) { my $u = URI->new($uri); @@ -100,13 +107,13 @@ foreach my $uri (@uris) { or die "Cannot open known_hosts: $!"; print $known_hosts "$rsa_key\n"; close($known_hosts); - $cmd = "curl -g -s -S -T $tmp_push_file $uri/$save_file"; + $cmd = "curl $src_opt -g -s -S -T $tmp_push_file $uri/$save_file"; $rc = system($cmd); print "\n"; } } } else { - $cmd = "curl -s -T $tmp_push_file $uri/$save_file"; + $cmd = "curl $src_opt -s -T $tmp_push_file $uri/$save_file"; $rc = system($cmd); } diff --git a/templates-cfg/system/config-management/commit-archive/source-address/node.def b/templates-cfg/system/config-management/commit-archive/source-address/node.def new file mode 100644 index 0000000..a013983 --- /dev/null +++ b/templates-cfg/system/config-management/commit-archive/source-address/node.def @@ -0,0 +1,2 @@ +type: txt +help: Source address or interface for archive server connections |