
Here is a PHP script that tracks IPs in log files and executes shell commands per each IP. It was created as a sort of reverse fail2ban or cheap VPN-firewall: a machine with a closed firewall can be told, by a foreign machine, to accept connections from a specific IP.