Re: How to run script on network address change?

From: Crest <crest_at_rlwinm.de>
Date: Mon, 21 Jun 2021 13:00:23 +0200
On 20.06.21 18:37, Rozhuk Ivan wrote:
> On Sun, 20 Jun 2021 16:23:38 +0200
> "dmilith ." <dmilith_at_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.
Received on Mon Jun 21 2021 - 11:00:23 UTC

Original text of this message