I’m a noob to MikroTik products and would like help writing a script.
The script needs to disable a PPP interface between 11PM and 6AM and write this to the log.
Thanks.
I’m a noob to MikroTik products and would like help writing a script.
The script needs to disable a PPP interface between 11PM and 6AM and write this to the log.
Thanks.
what ppp server do you want to disable and enable??
for pppoe server here is a script to find and disable acording to its name. you whould need 2 scripts one with enable=yes and the other disable=no and then set up a schedular to call out that script acording to your needs.
{
/interface pppoe-server server;
:foreach i in=[find] do={
:local content
:set content [/interface pppoe-server server get $i service-name]
:if ($content =“service4”) do={
set $i disabled=yes
}
}
}
Thanks for the help. I’ve been trying to print the time to the log too - can’t figure it out.
when you post something into log - log has time when this is done (that is if you have set up ntp client and you have correct time on the router.
Hi, don’t creating new topic - write here:
Was have working script on ROS 3.x
Upgrading OS to 5.x
My script doesn’t work. Was reading ROS 5.x Script Manual, finding exampels - nothing help.
Please - help me find mistake.
#count config
:local start ("83");
:local stop ("99");
#(ip->dhcp-sever->network)
###################################################################
:global count ($start);
:for count from=$start to=$stop step=1 do={
/ip dhcp-server network add address=10.80.$count.0/24 gateway=10.80.$count.1 dns-server=8.8.8.8 domain=xxx.xxx;}
Thanks a lot.
Wrap all the addresses in the last line in quotation marks.
address=10.80.$count.0/24
vs
address="10.80.$count.0/24"
Yarrrr, my fault. I’ve trying (“”),“”.“” etc. but not “”
Thank you so much ![]()