Schedule disable and enable of and interface

Hi Guy’s

I am trying to workout how to write a script that will disable an interface on Sunday at midnight and them enable it on Friday at 8 pm??

Thanks Mark

copy this between the doted lines, then open a terminal in winbox and right click then paste

/system scheduler
add name=“Friday” on-event=enable start-date=jan/01/1970 start-time=20:00:00
interval=1w comment=“” disabled=no
add name=“Sunday” on-event=disable start-date=jan/01/1970 start-time=23:00:00
interval=1w comment=“” disabled=no
/system script
add name=“enable” source=“/interface ethernet enable ether1”
policy=ftp,reboot,read,write,policy,test,winbox,password
add name=“disable” source=“/interface ethernet disable ether1”
policy=ftp,reboot,read,write,policy,test,winbox,password

change the start date to last friday(last friday because i gave it a 1 week interval), and same for sunday, and make sure the date and time are right on the MT board. You can change the start date by clicking system , Scheduler and double clicking the schedule in winbox.

you didnt say what interface you wanted to disable so i just did the ether if you want to make it wireless then goto system, scripts, and change the source of them from
/interface ethernet disable ether1 to
/interface wireless disable wlan1

did not test this either but should work just fine.
you can test it by changing the start time to 5 mins from when you do this just make sure you set the enable one first dont want an ethernet turned off so you have to break out the consol cable.

Thanks …I am going to test the script. I will let you know how I get on.