From 4caf959577c2b4351ba45f71dcaee55484970430 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 3 Nov 2017 14:58:17 +0100 Subject: T281: Add https support to the load command --- etc/bash_completion.d/vyatta-cfg | 1 + scripts/vyatta-load-config.pl | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/etc/bash_completion.d/vyatta-cfg b/etc/bash_completion.d/vyatta-cfg index 22f9dd3..7e37e74 100755 --- a/etc/bash_completion.d/vyatta-cfg +++ b/etc/bash_completion.d/vyatta-cfg @@ -198,6 +198,7 @@ vyatta_loadsave_complete() echo -e " sftp://:@/\tLoad from file on remote machine" echo -e " ftp://:@/\tLoad from file on remote machine" echo -e " http:///\t\t\tLoad from file on remote machine" + echo -e " https:///\t\t\tLoad from file on remote machine" echo -e " tftp:///\t\t\tLoad from file on remote machine" elif [ "$command" = "merge" ]; then echo -e " \t\t\t\tMerge from system config file" diff --git a/scripts/vyatta-load-config.pl b/scripts/vyatta-load-config.pl index 517b7ff..de6d9ab 100755 --- a/scripts/vyatta-load-config.pl +++ b/scripts/vyatta-load-config.pl @@ -75,11 +75,12 @@ if ( $load_file =~ /^[^\/]\w+:\// ) { if ( $load_file =~ /^(\w+):\/\/\w/ ) { $mode = 'url'; $proto = lc($1); - unless( $proto eq 'tftp' || - $proto eq 'ftp' || - $proto eq 'http' || - $proto eq 'scp' || - $proto eq 'sftp' ) { + unless( $proto eq 'tftp' || + $proto eq 'ftp' || + $proto eq 'http' || + $proto eq 'https' || + $proto eq 'scp' || + $proto eq 'sftp' ) { die "Invalid url protocol [$proto]\n"; } } else { @@ -104,7 +105,6 @@ elsif ( $mode eq 'url' ) { exit 1; } if ( $proto eq 'http' ) { - # # error codes are send back in html, so 1st try a header # and look for "HTTP/1.1 200 OK" -- cgit v1.2.3