openwisp / openwisp-config

OpenWRT configuration agent for OpenWISP Controller
https://openwisp.io/docs/stable/openwrt-config-agent/
GNU General Public License v3.0
374 stars 59 forks source link

[feature] Add hotplug events #180

Closed okraits closed 2 years ago

okraits commented 2 years ago

Resolves #179

okraits commented 2 years ago

@nemesisdesign Is this ready to get merged?

okraits commented 2 years ago

I tested this and it's great Oliver, thank you!

You're welcome :grin:

I am thinking about another case which is useful: can we send an hotplug event when the agent starts? That way we can execute scripts whenever the agent is reloaded or started.

Yes, I think we can do that. This could be useful, too.

Can we also pass arguments to the hotplug events? For example in this startup hotplug event it would be useful to pass whether it's a bootup start (first start when a device boots) or not (reload, restart).

I'm not sure if we can pass arguments, but we could use two different actions for the startup event.

@nemesisdesign I added two additional actions bootup and restart for the events you mentioned.