Re: How to run script on network address change?

From: Crest <crest_at_rlwinm.de>
Date: Mon, 21 Jun 2021 11:00:23 UTC
On 20.06.21 18:37, Rozhuk Ivan wrote:
> On Sun, 20 Jun 2021 16:23:38 +0200
> "dmilith ." <dmilith@gmail.com> wrote:
>
>> Have you tried `route monitor`?
>   
> No, and I do not want keep running some daemon that will parse output.
>
> But thanks, I found good place to add devctl_notify() calls.
> Now devd have new events.
>
>
> run:
> ifconfig lan0 alias 192.168.1.1/24
> ifconfig lan0 -alias 192.168.1.1
> ifconfig lan0 inet6 1111::
>
> devd output:
> !system=IFNET subsystem=lan0 type=ADDR_ADD 192.168.1.1
> !system=IFNET subsystem=lan0 type=ADDR_DEL 192.168.1.1
> !system=IFNET subsystem=lan0 type=ADDR_ADD 1111::
>
>
> And even for netif rename:
> ifconfig lan0 name lan1
> ifconfig lan1 name lan0
>
> devd output:
> !system=IFNET subsystem=lan0 type=RENAME lan1
> !system=IFNET subsystem=lan1 type=RENAME lan0
Those events would be *very* useful to me although it's probably a good 
idea to add a sysctl to disable their generation on systems with very 
high address churn.