You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
585 B
30 lines
585 B
<?php
|
|
require_once __DIR__ . '/../vendor/autoload.php';
|
|
|
|
error_reporting(E_ALL);
|
|
|
|
use \RouterOS\Client;
|
|
use \RouterOS\Query;
|
|
|
|
// Initiate client with config object
|
|
$client = new Client([
|
|
'timeout' => 1,
|
|
'host' => '127.0.0.1',
|
|
'user' => 'admin',
|
|
'pass' => 'admin'
|
|
]);
|
|
|
|
$ips = [
|
|
'192.168.1.1',
|
|
'192.168.1.2',
|
|
'192.168.1.3',
|
|
'192.168.1.4',
|
|
'192.168.1.5',
|
|
'192.168.1.6',
|
|
];
|
|
|
|
foreach ($ips as $ip) {
|
|
$query = new Query('/queue/simple/print', ['?target=' . $ip . '/32']);
|
|
$response = $client->wr($query);
|
|
print_r($response);
|
|
}
|