Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $file = file_get_contents("/var/log/fail2ban.log");
- $file = explode("\n", $file);
- foreach ($file as $k => $v) {
- $v = explode("WARNING [ssh]", $v);
- $v = explode(" ", $v[1]);
- $v = trim($v[2]);
- if ($v) {
- $ips[$v] = $v;
- }
- }
- foreach ($ips as $k => $v) {
- echo $v."<br>\n";
- $i++;
- }
- echo "\n\n";
- echo $i." ips.";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement