Create fail2ban DB if it doesn't exist

This commit is contained in:
Daniel Berteaud 2013-05-09 11:15:42 +02:00
parent 5420a45ffa
commit 77ba56b52e
2 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,6 @@
{
my $f2bdb = esmith::ConfigDB->open_ro('fail2ban');
my $f2bdb = esmith::ConfigDB->open_ro('fail2ban') ||
esmith::ConfigDB->create('fail2ban');
# Find the current Fail2Ban_$$ chain, and create a new one.
$OUT .=<<'EOF';
OLD_Fail2Ban=$(get_safe_id Fail2Ban filter find)

View File

@ -5,7 +5,7 @@ use warnings;
use esmith::ConfigDB;
use Getopt::Long;
our $f2bdb = esmith::ConfigDB->open('fail2ban');
our $f2bdb = esmith::ConfigDB->open('fail2ban') || esmith::ConfigDB->create('fail2ban');
our $c = esmith::ConfigDB->open_ro;
our %opts;