summaryrefslogtreecommitdiff
path: root/scripts/vyatta-save-config.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/vyatta-save-config.pl')
-rwxr-xr-xscripts/vyatta-save-config.pl5
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/(.*)@(.*)/) {