From ce2b145185aed9a9306380a46f773d211623df45 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 25 Feb 2020 10:38:05 +0100 Subject: [PATCH] Firewall/alias/geoip. make sure to trigger a download if no stats are found. Which should fix startup issues when aliases don't require a change and a new valid subscription is entered. --- src/opnsense/scripts/filter/update_tables.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/opnsense/scripts/filter/update_tables.py b/src/opnsense/scripts/filter/update_tables.py index 8a6ea1dd5..a9de9963b 100755 --- a/src/opnsense/scripts/filter/update_tables.py +++ b/src/opnsense/scripts/filter/update_tables.py @@ -39,6 +39,7 @@ import syslog import subprocess import glob from lib.alias import Alias +import lib.geoip as geoip urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) @@ -109,6 +110,10 @@ if __name__ == '__main__': if not os.path.isdir('/var/db/aliastables'): os.makedirs('/var/db/aliastables') + # make sure we download geoip data if not found. Since aliases only will trigger a download when change requires it + if not os.path.isfile('/usr/local/share/GeoIP/alias.stats'): + geoip.download_geolite() + try: source_tree = ET.ElementTree(file=inputargs.source_conf) except ET.ParseError as e: