aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Herkt <lachs0r@srsfckn.biz>2017-10-27 02:21:33 +0200
committerMartin Herkt <lachs0r@srsfckn.biz>2017-10-27 02:21:33 +0200
commitdef5d9802f375b1ba9da443d8a889c175e2bdd3f (patch)
tree2bd557f4367c722828b37fe4be3240a4921275c3
parentFix try/except syntax (diff)
downloadhex-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-xfhost.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/fhost.py b/fhost.py
index 5e35104..31a3703 100755
--- a/fhost.py
+++ b/fhost.py
@@ -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()
bgstack15