summaryrefslogtreecommitdiff
path: root/scripts/vyatta-load-config.pl
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2007-11-07 14:37:06 -0800
committerAn-Cheng Huang <ancheng@vyatta.com>2007-11-07 14:37:06 -0800
commit92b873bd7cddbdd355cff8fa9cbc9baf0496766a (patch)
treee2acd5272a79bf8f828862dabc290362b23965d7 /scripts/vyatta-load-config.pl
parentef652f073bde6af2736d0e1a78fbcd47b3f0ed85 (diff)
downloadvyatta-cfg-92b873bd7cddbdd355cff8fa9cbc9baf0496766a.tar.gz
vyatta-cfg-92b873bd7cddbdd355cff8fa9cbc9baf0496766a.zip
allow loading empty config file
Diffstat (limited to 'scripts/vyatta-load-config.pl')
-rwxr-xr-xscripts/vyatta-load-config.pl9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/vyatta-load-config.pl b/scripts/vyatta-load-config.pl
index a0b53d5..a6f037a 100755
--- a/scripts/vyatta-load-config.pl
+++ b/scripts/vyatta-load-config.pl
@@ -28,8 +28,13 @@ if (!($load_file =~ /^\//)) {
print "Loading config file $load_file...\n";
my %cfg_hier = VyattaConfigLoad::loadConfigHierarchy($load_file);
if (scalar(keys %cfg_hier) == 0) {
- print "Load failed\n";
- exit 1;
+ print "The specified file does not contain any configuration.\n";
+ print "Do you want to remove everything in the running configuration? [no] ";
+ my $resp = <STDIN>;
+ if (!($resp =~ /^yes$/i)) {
+ print "Configuration not loaded\n";
+ exit 1;
+ }
}
my %cfg_diff = VyattaConfigLoad::getConfigDiff(\%cfg_hier);