Page 1 of 1

Triggered execution? Interface up/down etc

Posted: Tue Aug 20, 2019 9:12 am
by millenium7
Is there a way to have scripts run on a triggered event rather than by scheduler?
In particular i'm looking for a way to run a script when an interface goes up or down

I can see this can be done on VRRP or PPPoE servers (via profile) but I actually need an event to run when the PPPoE Client interface goes down/up

Re: Triggered execution? Interface up/down etc

Posted: Tue Aug 20, 2019 12:55 pm
by sebastia
Hey

To my knowledge not directly. There is the netwatch, with up & down scripts, but it's no synchronous. It will not be triggered by event, but by (delayed) detection.

Re: Triggered execution? Interface up/down etc

Posted: Tue Aug 20, 2019 1:07 pm
by nescafe2002
PPP profile works for servers and clients.

/ppp profile
add name=profile1 on-down="/log info \"Client disconnected\"" on-up="/log info \"Client connected\""
/interface pppoe-client
add name=pppoe-out1 profile=profile1 user=test

Result:

12:05:10 pppoe,ppp,info pppoe-out1: authenticated 
12:05:10 pppoe,ppp,info pppoe-out1: connected 
12:05:10 script,info Client connected  <------
12:05:19 pppoe,ppp,info pppoe-out1: terminating... - administrator request 
12:05:19 system,info device changed by admin 
12:05:19 pppoe,ppp,info pppoe-out1: disabled 
12:05:19 script,info Client disconnected  <------

Re: Triggered execution? Interface up/down etc

Posted: Tue Aug 20, 2019 1:57 pm
by millenium7
Ah maybe it does work then. I'll lab it up tomorrow and see how it goes

Nothing for ethernet though I presume?

Re: Triggered execution? Interface up/down etc

Posted: Wed Aug 21, 2019 7:31 am
by millenium7
Yep works perfectly, thanks

Re: Triggered execution? Interface up/down etc

Posted: Thu Aug 22, 2019 12:10 am
by eworm
Nothing for ethernet though I presume?
Sadly no. That's on my wishlist as well.