Good Morning Friends,
i have multiple mikrotik routers as RRAS, i want to send disconnection through php API.
is there any way to send random disconnection for users to RAS server instead of individual user through mikrotik .id
<?php
use PEAR2\Net\RouterOS;
require_once 'PEAR2_Net_RouterOS-1.0.0b5.phar';
$util = new RouterOS\Util($client = new RouterOS\Client('192.168.88.1', 'admin', 'password'));
$util->setMenu('/ip hotspot active');
$userIds = $util->getAll(array('.proplist' => '.id'));
$userIdsCount = count($userIds);
if ($userIdsCount > 0) {
$idToDisconnect = $userIds[mt_rand(0, $userIdsCount - 1)]->getProperty('.id');
$util->remove($idToDisconnect);
}
$util->setMenu('/ip hotspot active');