From 462e974d1e3511c3f8b975ef9139d5e7163769bf Mon Sep 17 00:00:00 2001 From: Jared Johnson Date: Fri, 7 Nov 2014 15:58:12 -0600 Subject: [PATCH] leave register() if neither geoip module loads --- plugins/ident/geoip | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/ident/geoip b/plugins/ident/geoip index df66dd1..04ba319 100644 --- a/plugins/ident/geoip +++ b/plugins/ident/geoip @@ -129,8 +129,12 @@ sub register { $self->{_args} = {@args}; $self->{_args}{db_dir} ||= '/usr/local/share/GeoIP'; - $self->load_geoip2() and return; - $self->load_geoip1(); + $self->load_geoip() or return; +} + +sub load_geoip { + $self->load_geoip2() and return 1; + $self->load_geoip1() and return 1; } sub load_geoip1 { @@ -152,6 +156,7 @@ sub load_geoip1 { $self->init_my_country_code(); $self->register_hook('connect', 'geoip_lookup'); + return 1; } sub load_geoip2 {