I feel like I am missing something very obvious here. I want to run a script when my WiFi AP (and also mesh for that matter) devices are up and configured. All the
wifi-ifaces on my router are bridged with the
br-lan bridge with the option
option network 'lan'.
I have multiple scripts on my router, that turn WiFi on or off based on certain events like WAN connection state, VPN state etc, time-based trigger etc. Also, the WiFi is sometimes toggled with a hardware button on the router.
I want to "listen" to the event of the WiFi radio being up and hostapd completed with the configuration, so that I can set certain options on the device using
iw commands. (I cannot set these options in
/etc/config/wireless because hostapd doesn't support them)
Adding a script to
/etc/hotplug.d/ieee80211- both do not recieve any event when the WiFi AP devices go up or down, probably because they are all "ports" of the bridge interface and devices part of a bridge do not invoke hotplug
Using the procd interface triggers in an init.d script - Doesn't recieve any event either, probably due to the same reason as above.
Time-triggerred cron job - Not a reliable option because sometimes the time trigger runs after the wifi interfaces are already up and client devices have already scanned and connected to the router before the custom settings get applied.
ubus monitor, I have seen that there are changes that occur in the
hostapd objects when WiFi devices go up/down, but haven't been able to find anyway to use those change events to trigger a script. (Either that is not simply possible or the documentation for it is just missing)