Add querybl command to query uploads by addresses in blacklist
This commit is contained in:
parent
2e509a1faf
commit
def5d9802f
1 changed files with 11 additions and 0 deletions
11
fhost.py
11
fhost.py
|
@ -438,5 +438,16 @@ def queryaddr(a):
|
||||||
for f in res:
|
for f in res:
|
||||||
query(su.enbase(f.id, 1))
|
query(su.enbase(f.id, 1))
|
||||||
|
|
||||||
|
@manager.command
|
||||||
|
def querybl():
|
||||||
|
if os.path.isfile(app.config["FHOST_UPLOAD_BLACKLIST"]):
|
||||||
|
with open(app.config["FHOST_UPLOAD_BLACKLIST"], "r") as bl:
|
||||||
|
for l in bl.readlines():
|
||||||
|
if not l.startswith("#"):
|
||||||
|
if not ":" in l:
|
||||||
|
queryaddr("::ffff:" + l.rstrip())
|
||||||
|
else:
|
||||||
|
queryaddr(l.strip())
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
manager.run()
|
manager.run()
|
||||||
|
|
Loading…
Reference in a new issue