Community discussions

MikroTik App
 
User avatar
heislerb
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 56
Joined: Mon Sep 16, 2013 4:41 pm

PASSING SCHEDULE NAME TO SCRIPT

Sat Jan 25, 2014 2:40 am

I have a schedule and it's name is a MAC address. I have a firewall filter rule that blocks that same source MAC address. I am about to write a script to find and delete the firewall filter rule and then delete the schedule. This process may be repeated with another schedule and filter rule block and it's name may be a different MAC address. I already have a script that creates the firewall filter rule and the schedule.

How do I pass the schedule name (mac address) to the second script, which I am trying to create?

The mac address could be passed to the schedule's event area when the schedule is created by a script, if this can be used.

Thanks
Bob
 
User avatar
skot
Long time Member
Long time Member
Posts: 584
Joined: Wed Nov 30, 2011 3:05 am

Re: PASSING SCHEDULE NAME TO SCRIPT

Mon Jan 27, 2014 8:18 pm

To delete a schedule based on the name, do this:

ros code

/system scheduler remove [find name="00:0C:42:12:34:56"]
 
User avatar
heislerb
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 56
Joined: Mon Sep 16, 2013 4:41 pm

Re: PASSING SCHEDULE NAME TO SCRIPT

Tue Jan 28, 2014 3:16 am

Thanks for the reply. I will give this a try when I get back to working on that.

So, I could put that command in a script or put it in the event area of a schedule?

Thanks again
Bob
 
User avatar
skot
Long time Member
Long time Member
Posts: 584
Joined: Wed Nov 30, 2011 3:05 am

Re: PASSING SCHEDULE NAME TO SCRIPT

Tue Jan 28, 2014 6:37 am

So, I could put that command in a script or put it in the event area of a schedule?
Yep, either one will work.
 
User avatar
heislerb
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 56
Joined: Mon Sep 16, 2013 4:41 pm

Re: PASSING SCHEDULE NAME TO SCRIPT

Tue Jan 28, 2014 4:11 pm

Thanks again!
Bob