Determining WLAN status (running ap, detecting radar etc)

Hi there,

How can I determine the status of the access point through the terminal or scripts?

I need to determine in a script whether the WLAN status is currently “running ap”, or “detecting radar”, or whatever else.

In Winbox I can see it by double clicking on the interface and looking at the footer, but so far I haven’t been able to find that information in the terminal.