From acdcedfa7099659be22df3dd57ec4926809dc1a6 Mon Sep 17 00:00:00 2001 From: Janik Kleinhoff Date: Fri, 4 Sep 2015 03:44:40 +0000 Subject: Allow running without a database This is mostly a workaround for the DB being a bit of a PITA to set up, but not all we do requires a DB so we might as well offer to run without one. --- modules/inspect.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules/inspect.pl') diff --git a/modules/inspect.pl b/modules/inspect.pl index ea287ff..df515dc 100644 --- a/modules/inspect.pl +++ b/modules/inspect.pl @@ -74,7 +74,9 @@ sub inspect { return unless (ASM::Util->notRestricted($nick, "notrigger") && ASM::Util->notRestricted($nick, "no$id")); $xresult = $dct{$id}{xresult}; my $nicereason = interpolate($dct{$id}{reason}); - $::db->record($chan, $event->{nick}, $event->{user}, $event->{host}, $::sn{lc $event->{nick}}->{gecos}, $dct{$id}{risk}, $id, $nicereason); + if (defined $::db) { + $::db->record($chan, $event->{nick}, $event->{user}, $event->{host}, $::sn{lc $event->{nick}}->{gecos}, $dct{$id}{risk}, $id, $nicereason); + } $txtz = "\x03" . $::RCOLOR{$::RISKS{$dct{$id}{risk}}} . "\u$dct{$id}{risk}\x03 risk threat [\x02$chan\x02] - ". "\x02$event->{nick}\x02 - ${nicereason}; ping "; $txtz = $txtz . ASM::Util->commaAndify(ASM::Util->getAlert(lc $chan, $dct{$id}{risk}, 'hilights')) if (ASM::Util->getAlert(lc $chan, $dct{$id}{risk}, 'hilights')); -- cgit v1.2.3