diff options
author | Martin Herkt <lachs0r@srsfckn.biz> | 2017-10-27 02:21:33 +0200 |
---|---|---|
committer | Martin Herkt <lachs0r@srsfckn.biz> | 2017-10-27 02:21:33 +0200 |
commit | def5d9802f375b1ba9da443d8a889c175e2bdd3f (patch) | |
tree | 2bd557f4367c722828b37fe4be3240a4921275c3 | |
parent | Fix try/except syntax (diff) | |
download | hex-zero-def5d9802f375b1ba9da443d8a889c175e2bdd3f.tar.gz hex-zero-def5d9802f375b1ba9da443d8a889c175e2bdd3f.tar.bz2 hex-zero-def5d9802f375b1ba9da443d8a889c175e2bdd3f.zip |
Add querybl command to query uploads by addresses in blacklist
-rwxr-xr-x | fhost.py | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -438,5 +438,16 @@ def queryaddr(a): for f in res: 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__": manager.run() |