summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);