Tweaks to convert_blacklist()

- Reword an error message to handle both missing file and zero-sized file.
- Don't rename file that doesn't exist.
This commit is contained in:
Tom Eastep 2011-11-21 12:13:39 -08:00
parent 1a968ec734
commit 4559c8b5d0

View File

@ -528,12 +528,13 @@ EOF
close $blrules;
} else {
warning_message q(There are interfaces or zones with the 'blacklist' option but the 'blacklist' file is empty) unless @rules;
warning_message q(There are interfaces or zones with the 'blacklist' option but the 'blacklist' file is empty or does not exist) unless @rules;
}
rename $fn, "$fn.bak";
progress_message2 "Blacklist file $fn saved in $fn.bak";
if ( -f $fn ) {
rename $fn, "$fn.bak";
progress_message2 "Blacklist file $fn saved in $fn.bak";
}
for my $file ( qw(zones interfaces hosts) ) {
remove_blacklist $file;