Script for disabling wlan

I need a script that would track the records in the ARP table on the client access point, and if there is no records relating to the LAN port of SXT disabling wireless interface (on client sxt) and enable it back when a record appear.

ARP is dynamic, without any filters.
I want to track records that contains IP`s 192.168.1.*

Omnitik configured as router (wan - ether1 (dhcp), lan - wlan1 (192.168.0.1/24))
SXT`s configured as routers to (wan - wlan1(192.168.0.2/24, lan - ether1(192.168.1.1/24))

if the client turns on the computer once a day for two hours then the wlan1 on his SXT should work the same time.

Thanks for your ideas.

Anyone?

If the omnitik is handing out dhcp, there is no way for the client pc to have an IP address prior to SXT WLAN being enabled, therefore nothing in the arp table. Would be easy enough to do if client pc had static address or a second deco server was set up on the SXT

I need to analyze ARP table on client SXT, that configured as router and provide dhcp for users behind LAN port.
If are no clients behind lan (arp table dont consist of IP`s 192.168.1.*) SXT must to disable wlan1 interface.
The script will run on SXT.

Here is something that may get you going, I would suggest it being scheduled to run evey 5-10 seconds.

/interface {
    :local arps [:len [/ip arp find interface=ether1]]
    :local wlan [find name=wlan1]
    :local state [get $wlan disabled]
    :if ($state = true && aprs > 0) do={
        set $wlan disabled=false
    } else={
        :if ($state = false && aprs = 0) do={
            set $wlan disabled=true
        }
    }
}

Thank you.
According to the script, that’s exactly what I was looking for, but for some reason does not work.

Tested on rb751 and SXT. ROS v5.20

Well, I was to lazy to test it, this is tested and should work:

/interface {
    :local arps [:len [/ip arp find interface=ether1]]
    :local wlan [find name=wlan1]
    :local inact [get $wlan disabled]
    :if ($inact = true && $arps > 0) do={
        set $wlan disabled=no
    } else={
        :if ($inact = false && $arps = 0) do={
            set $wlan disabled=yes
        }
    }
}

Excellent, it works. Thank you very much.
I think this script will help relieve some of the base stations.