mirror of https://github.com/MISP/misp-modules
Do not crash if the dat file is not available
parent
064c3e3649
commit
9bf1c936cf
|
@ -21,10 +21,14 @@ moduleinfo = {'version': '0.1', 'author': 'Andreas Muehlemann',
|
|||
'description': 'Query a local copy of Maxminds Geolite database',
|
||||
'module-type': ['expansion', 'hover']}
|
||||
|
||||
# get current db from http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
|
||||
config = configparser.ConfigParser()
|
||||
config.read(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'geoip_country.cfg'))
|
||||
gi = pygeoip.GeoIP(config.get('GEOIP', 'database'))
|
||||
try:
|
||||
# get current db from http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
|
||||
config = configparser.ConfigParser()
|
||||
config.read(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'geoip_country.cfg'))
|
||||
gi = pygeoip.GeoIP(config.get('GEOIP', 'database'))
|
||||
enabled = True
|
||||
except:
|
||||
enabled = False
|
||||
|
||||
|
||||
def handler(q=False):
|
||||
|
|
Loading…
Reference in New Issue