diff options
author | Leon Messner <elon@zwelf.net> | 2015-10-25 15:57:59 +0100 |
---|---|---|
committer | Leon Messner <elon@zwelf.net> | 2015-10-25 15:57:59 +0100 |
commit | 5a67b5f11976a24d4c4fe40b91ff4fc0f55a0429 (patch) | |
tree | 52dfe3e1ea247a6f8ce5c715264cd3d5e5ac22c2 /scripts/vyatta-save-config.pl | |
parent | 76c30a8d299c6887512e843534c44546f0074e12 (diff) | |
download | vyatta-cfg-5a67b5f11976a24d4c4fe40b91ff4fc0f55a0429.tar.gz vyatta-cfg-5a67b5f11976a24d4c4fe40b91ff4fc0f55a0429.zip |
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..439e873 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/(.*)@(.*)/) { |