Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $blackhole = array();
- $i = 0;
- exec('ip route list', $exec);
- foreach ($exec as $k => $v) {
- $pos = strpos($v, 'blackhole');
- // Note our use of ===. Simply == would not work as expected
- // because the position of 'a' was the 0th (first) character.
- if ($pos === false) {
- } else {
- $var = explode("blackhole ", $v);
- $blackhole[$var[1]] = $var[1];
- $i++;
- }
- }
- echo $i." IP's blocked
- ";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement