enable / disable radio script

Yes that is what I wanted to know thanks. I will give it a try. Still trying to learn ROS syntax.

Thank you very much Jarda.

Glad I could point you to a better way. Post your achievements if any as they could help someone in similar situation.

In this situation I check
[/system ntp client get last-update-before] < 3* [/system ntp client get poll-interval]

# tested on v5.4
# work with ntp package
# Resolve NTP server ip from name if time not synchronized
#
# Set ntp server names. Set to empty striing to keep untouched
:local primaryntp "ru.pool.ntp.org"
:local secondaryntp "2.ru.pool.ntp.org"

#
:if ([:len [/system package find name=ntp]] <= 0) do={
   :error "NTP update script work only with ntp package"
}

/system ntp client
:if ([get status] != "synchronized") do={
   :put "First NTP unsync"
   :delay 60;
   :if ([get status] != "synchronized") do={
      :put "Second NTP unsync. Update NTP IP.";
      :if ([:len $primaryntp] > 0) do={
         set primary-ntp [:resolve $primaryntp]}
      :if ([:len $secondaryntp] > 0) do={
         set secondary-ntp [:resolve $secondaryntp]}
      set enabled=no;
      :delay 1;
      set enabled=yes;
      :log warning "NTP client IP updated."
   }
}

It still dont make problems. Now work on 6.23 but i dont do deep verify.

It works GREAT..!!!
I use it and tested RB-751G-2HnD with OS versions 5.19, 6.27 and 6.28 and it works perfectly.
Thank James for a terrific script.
I hope to also find one to do the same with an ethernet port..!!
George V.

Hi,

I found all necessary steps here: http://mlapshin.com/index.php/2015/09/01/mikrotik-and-dads-job/

How to create scripts

  • Open System → Scripts window
    Press Add button and the script editor window will open
    Type a script name like DisableWLAN
    Select policies required by the script or check all of them
    Type script into the source text area: interface wireless disable wlan1
    Make sure you are using the proper name of the wireless interface. It could be found in the Interfaces section.
    Next you can try to test the script with “Run Script” button
    Save the script with “OK” button
    Create a similar EnableWLAN script.

How to schedule scripts

  • Open System → Scheduler window
    Press Add button to open the Scheduler window
    Type some meaningful name for the scheduled task like DisableWLAN
    Type the name of your script into the On Event text area like DisableWLAN
    Select the start date, start time (hh:mm:ss format) and the interval for repeating the action like 1d 00:00:00 (it means one day and no hours, minutes and secs)
    Select required policies or check them all
    Save the schedule with “OK” button
    Repeat the same to schedule the enabling script

http://wirelessinfo.be/index.php/mikrotik/pages/wireless-on-off

Thought i would use this nice tutorial to keep my children off internet in the mornings :smiley:

Edit

//Sonny

This works just like a charm :slight_smile:

Is there any way to make the schema only works on weekends, Saturday and Sunday?