summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMohit Mehta <mohit@vyatta.com>2008-03-24 18:26:53 -0700
committerMohit Mehta <mohit@vyatta.com>2008-03-24 18:26:53 -0700
commit9273d3172d39360d019d3e3256d2c537d2b71d80 (patch)
tree53881e5ebdf718bb5cb956bc191d1e69037f43fb /scripts
parent445f5b6de86f271605d2b6f8e1e9671ff9444218 (diff)
downloadvyatta-cfg-9273d3172d39360d019d3e3256d2c537d2b71d80.tar.gz
vyatta-cfg-9273d3172d39360d019d3e3256d2c537d2b71d80.zip
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'
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-load-config.pl13
1 files changed, 8 insertions, 5 deletions
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 <config_file_name>\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