From 9273d3172d39360d019d3e3256d2c537d2b71d80 Mon Sep 17 00:00:00 2001 From: Mohit Mehta Date: Mon, 24 Mar 2008 18:26:53 -0700 Subject: Fix Bug 2825 Load should read config file from default location when no argument is provided. - 'load' reads config file from default location just as 'save' --- scripts/vyatta-load-config.pl | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'scripts/vyatta-load-config.pl') diff --git a/scripts/vyatta-load-config.pl b/scripts/vyatta-load-config.pl index a432d8c..f845c24 100755 --- a/scripts/vyatta-load-config.pl +++ b/scripts/vyatta-load-config.pl @@ -28,16 +28,19 @@ use VyattaConfigLoad; my $etcdir = $ENV{vyatta_sysconfdir}; my $sbindir = $ENV{vyatta_sbindir}; my $bootpath = $etcdir . "/config"; +my $load_file = $bootpath . "/config.boot"; -if ($#ARGV != 0) { +if ($#ARGV > 0) { print "Usage: load \n"; exit 1; } -my $load_file = $ARGV[0]; -if (!($load_file =~ /^\//)) { - # relative path - $load_file = "$bootpath/$load_file"; +if (defined($ARGV[0])) { + $load_file = $ARGV[0]; + if (!($load_file =~ /^\//)) { + # relative path + $load_file = "$bootpath/$load_file"; + } } # do config migration -- cgit v1.2.3