(self)
Check if the GeoIP database is present on the system
        Depending on geoipupdate version it can be stored in:
        /usr/share/GeoIP/
        /var/lib/GeoIP
        /usr/local/var/GeoIP/
Check if the GeoIP database is present on the system
        Depending on geoipupdate version it can be stored in:
        /usr/share/GeoIP/
        /var/lib/GeoIP
        /usr/local/var/GeoIP/
Check if the GeoIP database is present on the system Depending on geoipupdate version it can be stored in : / usr / share / GeoIP / / var / lib / GeoIP / usr / local / var / GeoIP /
def check_geoipdb(self):
        """
        Check if the GeoIP database is present on the system
        Depending on geoipupdate version it can be stored in:
        /usr/share/GeoIP/
        /var/lib/GeoIP
        /usr/local/var/GeoIP/
        """
        if os.path.isfile("/usr/share/GeoIP/GeoLite2-City.mmdb"):
            self.geocity = "/usr/share/GeoIP/GeoLite2-City.mmdb"
        elif os.path.isfile("/var/lib/GeoIP/GeoLite2-City.mmdb"):
            self.geocity = "/var/lib/GeoIP/GeoLite2-City.mmdb"
        elif os.path.isfile("/usr/local/var/GeoIP/GeoLite2-City.mmdb"):
            self.geocity = "/usr/local/var/GeoIP/GeoLite2-City.mmdb"
        else:
            print("Impossible to find GeoIP db")
            print("Make sure you have geoipupdate correctly configured")
            sys.exit(1)

        if os.path.isfile("/usr/share/GeoIP/GeoLite2-ASN.mmdb"):
            self.geoasn = "/usr/share/GeoIP/GeoLite2-ASN.mmdb"
        elif os.path.isfile("/var/lib/GeoIP/GeoLite2-ASN.mmdb"):
            self.geoasn = "/var/lib/GeoIP/GeoLite2-ASN.mmdb"
        elif os.path.isfile("/usr/local/var/GeoIP/GeoLite2-ASN.mmdb"):
            self.geoasn = "/usr/local/var/GeoIP/GeoLite2-ASN.mmdb"
        else:
            print("Impossible to find GeoIP ASN db")
            print("Make sure you have geoipupdate correctly configured")
            print("It should include this configuration")
            print("EditionIDs GeoLite2-Country GeoLite2-City GeoLite2-ASN")
            sys.exit(1)
def check_geoipdb ( self ) : if os . path . isfile ( "/usr/share/GeoIP/GeoLite2-City.mmdb" ) : self . geocity = "/usr/share/GeoIP/GeoLite2-City.mmdb" elif os . path . isfile ( "/var/lib/GeoIP/GeoLite2-City.mmdb" ) : self . geocity = "/var/lib/GeoIP/GeoLite2-City.mmdb" elif os . path . isfile ( "/usr/local/var/GeoIP/GeoLite2-City.mmdb" ) : self . geocity = "/usr/local/var/GeoIP/GeoLite2-City.mmdb" else : print ( "Impossible to find GeoIP db" ) print ( "Make sure you have geoipupdate correctly configured" ) sys . exit ( 1 ) if os . path . isfile ( "/usr/share/GeoIP/GeoLite2-ASN.mmdb" ) : self . geoasn = "/usr/share/GeoIP/GeoLite2-ASN.mmdb" elif os . path . isfile ( "/var/lib/GeoIP/GeoLite2-ASN.mmdb" ) : self . geoasn = "/var/lib/GeoIP/GeoLite2-ASN.mmdb" elif os . path . isfile ( "/usr/local/var/GeoIP/GeoLite2-ASN.mmdb" ) : self . geoasn = "/usr/local/var/GeoIP/GeoLite2-ASN.mmdb" else : print ( "Impossible to find GeoIP ASN db" ) print ( "Make sure you have geoipupdate correctly configured" ) print ( "It should include this configuration" ) print ( "EditionIDs GeoLite2-Country GeoLite2-City GeoLite2-ASN" ) sys . exit ( 1 )