What I am going to do is, that blacklist.php will generate all the Mikrotik command like the following:
Code: Select all
/ip firewall address-list add list=blacklist address=<blacklisted IPs from DB>
However, I am clueless how to run the generated file into Mikrotik. Anyone know how to do this into the script?
Lets say the script's scenario is like this:
1. Execute /tool fetch url="http://blablabla/servercmd.php" http-method=post http-data="op=mikrotik" output="runremotescript"
2. Execute all the generated Mikrotik's commands in runremotescript
the runremotescript will be like this:
1. /ip firewall address-list add list=blacklist address=<generated from http://blablabla/servercmd.php>
Example:
Code: Select all
/ip firewall address-list add list=blacklist address=123.25.25.128