Hotplug script on wifi client connection

I would like to run a script to turn off wifi when a particular wifi client connects and disconnects from an SSID. is this possible?

yes it is possible to deactivate the wifi when a client disconnects, but it is possible that the client disconnects because it reaches a place where it does not get the signal and therefore the wifi would be deactivated even if this was not programmed.

the command that lets you know the associated clients is:
iwinfo wlan0 assoclist

I guess my description was too vague.

Right now i have a cronjob that checks the assoclist and runs a script if the macaddress is connected but i have to run every 2 minutes.

The script disables other ssids except the wds bridge when the mac address is connected.

But i would prefer this run only when the client associates, rather than as a cronjob.

I did a similar thing too...

so I don't know how to help you a reference could be in:

see DHCP-related events

Thanks, its a static /30 ip on the wds bridge. I guess theres no functional 80211mac hotplug events. I see a folder for it in hotplug.d but no output with env > /tmp/80211mac as a test script

The association of the client you can see in the system log, usually. Thus, something like 'logread -f || parselogmessage.sh' will do the job, assuming a smart script to parse the log messages.
The elegant alternative is to use hostapd and connect to it via its control socket using wpa-cli.