diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2007-11-07 14:37:06 -0800 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2007-11-07 14:37:06 -0800 |
commit | 92b873bd7cddbdd355cff8fa9cbc9baf0496766a (patch) | |
tree | e2acd5272a79bf8f828862dabc290362b23965d7 | |
parent | ef652f073bde6af2736d0e1a78fbcd47b3f0ed85 (diff) | |
download | vyatta-cfg-92b873bd7cddbdd355cff8fa9cbc9baf0496766a.tar.gz vyatta-cfg-92b873bd7cddbdd355cff8fa9cbc9baf0496766a.zip |
allow loading empty config file
-rwxr-xr-x | scripts/vyatta-load-config.pl | 9 |
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); |