cyph3r
1
I want to enabled and disable pptp service, this command is not running…
$API = new routeros_api();
$API->debug = true;
if ($API->connect($ipRAS, 'admin', 'admin')) {
$ARRAY = $API->comm('/interface/pptp-server/server/set/enabled=yes');
print_r($ARRAY);
$API->disconnect();
}
Result
Array ( [!trap] => Array ( [0] => Array ( [message] => no such command ) ) )
what is the exact command to this.. ???
enabling/disabling is an argument of “set”, so it needs to be written as such.
Plus, AFAIK, there’s no “enabled” argument, but a “disabled” one, so:
$API->comm('/interface/pptp-server/server/set', array('disabled'=> 'no');
cyph3r
3
there is a little change in your command .
This is the correct command..
$API->comm('/interface/pptp-server/server/set', array('enabled'=> 'yes'));
$API->comm('/interface/pptp-server/server/set', array('enabled'=> 'no'));
Thanks Boen bro.
it works