I’ve modified the Python script responsible for blocking SPAMMY Mediawiki IP’s to monitor the log file in real-time. There are also a couple of other changes:
- Added 1 second sleep to main loop to stop script eating 100% CPU, but still catch log data as it’s added.
- Added regex substitution to remove underscore characters from username (otherwise db searches for usernames containing spaces won’t work)
- Indented the second block of iptables code properly so it actually only blocks an IP if the user doesn’t exist.