On 2020-06-17, Lévai, Dániel <[email protected]> wrote:

> I'm trying to run a script whenever I get a new IP address from my ISP over 
> pppoe0. They disconnect me occasionally and the router reconnects then, eg.:
> /bsd: pppoe: GENERIC ERROR: RP-PPPoE: Child pppd process terminated
> /bsd: pppoe0: received unexpected PADO
> last message repeated 2 times
>
> I have this as the last line in /etc/hostname.pppoe0:
> !/bin/sh /etc/hostname.pppoe0.script pppoe0 0.0.0.1
>
> It doesn't seem to be executed when this happens, only when I reboot the 
> router.

/etc/hostname.* is only executed once when the system starts.

The PPP disconnect/reconnect is handled entirely by pppoe(4)--well,
sppp(4) really--in the kernel.  There is no callout to the userland
available.

It may be possible to use ifstated(8) for this.  I haven't tried
that, but it's where I would start looking.

> Is the culprit here something along the lines of not (re)configuring the 
> interface with ifconfig up/down (in which case the script would run),

Note that ifconfig down/up will not run /etc/hostname.* either.

-- 
Christian "naddy" Weisgerber                          [email protected]

Reply via email to