diff options
author | Daniil Baturin <daniil@baturin.org> | 2015-10-26 20:26:51 +0500 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2015-10-26 20:26:51 +0500 |
commit | 172d32988b31a7fe7f0842f8e50eb5295df7dba9 (patch) | |
tree | f474d91808359c0cb08c7a3d1e4182ce49c34ede | |
parent | 9f77a2176dc5c9e51c6e3dd9f7d79d297eb755ff (diff) | |
parent | 6189aaa14c703d4694652c3ff9fcedbaf6601657 (diff) | |
download | vyatta-config-mgmt-172d32988b31a7fe7f0842f8e50eb5295df7dba9.tar.gz vyatta-config-mgmt-172d32988b31a7fe7f0842f8e50eb5295df7dba9.zip |
Merge pull request #1 from elonhub/add-sftp
Bug 584 - Allow sftp as copy and commit-archive location destination.
-rwxr-xr-x | scripts/vyatta-commit-push.pl | 2 | ||||
-rwxr-xr-x | scripts/vyatta-config-mgmt.pl | 1 | ||||
-rw-r--r-- | templates-cfg/system/config-management/commit-archive/location/node.def | 1 |
3 files changed, 3 insertions, 1 deletions
diff --git a/scripts/vyatta-commit-push.pl b/scripts/vyatta-commit-push.pl index 2264164..1398533 100755 --- a/scripts/vyatta-commit-push.pl +++ b/scripts/vyatta-commit-push.pl @@ -85,7 +85,7 @@ foreach my $uri (@uris) { print " $remote "; my $rc = 0; - if ($scheme eq 'scp' ){ + if ($scheme =~ /^(scp|sftp)$/ ){ $cmd = "curl -s -S -T $tmp_push_file $uri/$save_file"; $rc = system($cmd); if( $rc >> 8 == 51 ){ diff --git a/scripts/vyatta-config-mgmt.pl b/scripts/vyatta-config-mgmt.pl index 5ec227c..de08e07 100755 --- a/scripts/vyatta-config-mgmt.pl +++ b/scripts/vyatta-config-mgmt.pl @@ -175,6 +175,7 @@ if ($action eq 'valid-uri') { if ($scheme eq 'tftp') { } elsif ($scheme eq 'ftp') { } elsif ($scheme eq 'scp') { + } elsif ($scheme eq 'sftp') { } else { print "Unsupported URI scheme\n"; exit 1; diff --git a/templates-cfg/system/config-management/commit-archive/location/node.def b/templates-cfg/system/config-management/commit-archive/location/node.def index c58b3b1..0ee2c19 100644 --- a/templates-cfg/system/config-management/commit-archive/location/node.def +++ b/templates-cfg/system/config-management/commit-archive/location/node.def @@ -9,5 +9,6 @@ syntax:expression: exec "/opt/vyatta/sbin/vyatta-config-mgmt.pl \ val_help: <uri> ; Uniform Resource Identifier comp_help: "scp://<user>:<passwd>@<host>/<dir>" + "sftp://<user>:<passwd>@<host>/<dir>" "ftp://<user>:<passwd>@<host>/<dir>" "tftp://<host>/<dir>" |