From ea7a3e1b585745ec94196eee4bcf94b393920917 Mon Sep 17 00:00:00 2001 From: sky Date: Sun, 3 May 2015 14:34:54 +0800 Subject: [PATCH] flush autoban output --- utils/autoban.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/autoban.py b/utils/autoban.py index d04ebbe..1bbb65c 100755 --- a/utils/autoban.py +++ b/utils/autoban.py @@ -42,10 +42,12 @@ if __name__ == '__main__': if ip not in ips: ips[ip] = 1 print(ip) + sys.stdout.flush() else: ips[ip] += 1 if ip not in banned and ips[ip] >= config.count: banned.add(ip) cmd = 'iptables -A INPUT -s %s -j DROP' % ip print(cmd, file=sys.stderr) + sys.stderr.flush() os.system(cmd)