#!/usr/bin/perl # Script to regenerate a sample rsyncd.conf dynamically # with a `hosts deny=' line based on rsync.log. # Assumes daily rotation of logfile. # (C) Tim Haynes, , 2004 # Redistributable under the terms of the GPL - see # print <) { chomp; next unless /rsync on gentoo-portage/; /rsync on gentoo-portage\/\* from .*\(([\d.]+)\)$/; $hash{$1}++; } close(F) or warn "Erkle, problems closing logfile: $! $?\n"; @badhosts=grep {$hash{$_}>4} keys %hash; print "hosts deny = " . join (" " , @badhosts) . "\n" if ($#badhosts>0); print <