|
@@ -51,7 +51,7 @@ def checkup():
|
|
|
unblocks = check_blocks()
|
|
|
if unblocks:
|
|
|
for ip in unblocks:
|
|
|
- log.info("Unblock {0}".format(ip))
|
|
|
+ log.info("Unblocked {0}".format(ip))
|
|
|
unblocker(ip)
|
|
|
rm_block(ip)
|
|
|
|
|
@@ -60,12 +60,14 @@ class EventHandler(ProcessEvent):
|
|
|
if myfile not in join(event.path, event.name):
|
|
|
return
|
|
|
else:
|
|
|
- luser = is_bad(TARGET.readline().rstrip())
|
|
|
- if(luser):
|
|
|
- blocker(luser["ip"])
|
|
|
- now = pendulum.now().to_atom_string()
|
|
|
- log.info("Blocked {0} at {1}".format(luser["ip"], now))
|
|
|
- add_block(luser["ip"], now)
|
|
|
+ #luser = is_bad(TARGET.readline().rstrip())
|
|
|
+ for line in TARGET.readline():
|
|
|
+ luser = is_bad(line.rstrip())
|
|
|
+ if(luser):
|
|
|
+ blocker(luser["ip"])
|
|
|
+ now = pendulum.now().to_atom_string()
|
|
|
+ log.info("Blocked {0} at {1}".format(luser["ip"], now))
|
|
|
+ add_block(luser["ip"], now)
|
|
|
|
|
|
|
|
|
def process_IN_MOVE_SELF(self, event):
|
|
@@ -102,7 +104,6 @@ while True:
|
|
|
notifier.process_events()
|
|
|
if notifier.check_events():
|
|
|
notifier.read_events()
|
|
|
- # Also check any of our blocks too
|
|
|
except KeyboardInterrupt:
|
|
|
break
|
|
|
|