summaryrefslogtreecommitdiff
path: root/scripts/vyatta-load-config.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/vyatta-load-config.pl')
-rwxr-xr-xscripts/vyatta-load-config.pl20
1 files changed, 6 insertions, 14 deletions
diff --git a/scripts/vyatta-load-config.pl b/scripts/vyatta-load-config.pl
index c3dc21f..a942019 100755
--- a/scripts/vyatta-load-config.pl
+++ b/scripts/vyatta-load-config.pl
@@ -53,27 +53,19 @@ if ( $load_file =~ /^[^\/]\w+:\// ) {
if ( $load_file =~ /^(\w+):\/\/\w/ ) {
$mode = 'url';
$proto = lc($1);
- if ( $proto eq 'tftp' ) {
+ unless( $proto eq 'tftp' ||
+ $proto eq 'ftp' ||
+ $proto eq 'http' ||
+ $proto eq 'scp' ) {
+ die "Invalid url protocol [$proto]\n";
}
- elsif ( $proto eq 'ftp' ) {
- }
- elsif ( $proto eq 'http' ) {
- }
- elsif ( $proto eq 'scp' ) {
- }
- else {
- print "Invalid url protocol [$proto]\n";
- exit 1;
- }
- }
- else {
+ } else {
print "Invalid url [$load_file]\n";
exit 1;
}
}
if ( $mode eq 'local' and !( $load_file =~ /^\// ) ) {
-
# relative path
$load_file = "$bootpath/$load_file";
}