User cjm1 asked once a feature to get notified automaticly on connection up/down. This is a linux only solution and notifies when connection is up and ready. Duplicating patches code to function where IP address is removed, you will also get notification on down.
This works on Linux udevadm, procd hotplug, udevd or any other similar solutions, this is a minimal patch that triggers change event on such time. Supports only linux, though can be adapted to bsd’s hotplugd as well very likely with very small effort.