diff options
author | Daniil Baturin <daniil@baturin.org> | 2015-10-26 20:26:43 +0500 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2015-10-26 20:26:43 +0500 |
commit | 1fb6bbb0cbb0cee505bb0feb743adf21a0fc24a7 (patch) | |
tree | fee927093a0a23656608a05ec53e0a4989675091 /scripts/vyatta-save-config.pl | |
parent | 76c30a8d299c6887512e843534c44546f0074e12 (diff) | |
parent | a04116d13ea5968403259c37fc55e618a98b9dd9 (diff) | |
download | vyatta-cfg-1fb6bbb0cbb0cee505bb0feb743adf21a0fc24a7.tar.gz vyatta-cfg-1fb6bbb0cbb0cee505bb0feb743adf21a0fc24a7.zip |
Merge pull request #5 from elonhub/add-sftp
Bug 584 - Allow sftp as copy and commit-archive location destination
Diffstat (limited to 'scripts/vyatta-save-config.pl')
-rwxr-xr-x | scripts/vyatta-save-config.pl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/vyatta-save-config.pl b/scripts/vyatta-save-config.pl index 96dd4b1..0799dd4 100755 --- a/scripts/vyatta-save-config.pl +++ b/scripts/vyatta-save-config.pl @@ -60,6 +60,7 @@ if ($save_file =~ /^[^\/]\w+:\//) { if ($proto eq 'tftp') { } elsif ($proto eq 'ftp') { } elsif ($proto eq 'scp') { + } elsif ($proto eq 'sftp') { } else { print "Invalid url protocol [$proto]\n"; exit 1; @@ -123,8 +124,8 @@ close $save; if ($mode eq 'url') { my $rc = 0; - if ($proto eq 'scp'){ - $save_file =~ m/scp:\/\/(.*?)\//; + if ($proto =~ /^(scp|sftp)$/){ + $save_file =~ m/(?:scp|sftp):\/\/(.*?)\//; my $host = $1; my $user = getpwuid($<); if ($host =~ m/(.*)@(.*)/) { |