diff options
Diffstat (limited to 'scripts/vyatta-load-config.pl')
-rwxr-xr-x | scripts/vyatta-load-config.pl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/vyatta-load-config.pl b/scripts/vyatta-load-config.pl index dc9ad6e..f6dfba3 100755 --- a/scripts/vyatta-load-config.pl +++ b/scripts/vyatta-load-config.pl @@ -78,7 +78,8 @@ if ( $load_file =~ /^[^\/]\w+:\// ) { unless( $proto eq 'tftp' || $proto eq 'ftp' || $proto eq 'http' || - $proto eq 'scp' ) { + $proto eq 'scp' || + $proto eq 'sftp' ) { die "Invalid url protocol [$proto]\n"; } } else { @@ -127,8 +128,8 @@ elsif ( $mode eq 'url' ) { } } my $rc = system("curl -# -o $url_tmp_file $load_file"); - if ($proto eq 'scp' && ($rc >> 8) == 51){ - $load_file =~ m/scp:\/\/(.*?)\//; + if ($proto =~ /^(scp|sftp)$/ && ($rc >> 8) == 51){ + $load_file =~ m/(scp|sftp):\/\/(.*?)\//; my $host = $1; if ($host =~ m/.*@(.*)/) { $host = $1; |