Plugin developpement - Question

Started by SimpleRezo, November 26, 2019, 01:47:45 AM

Previous topic - Next topic
Hi

I working on an internal plugin for OPNSense (using MVC).

I have a small question: how can I run some code from my plugin everytime configd is started/restarted?

Thanks for your help!
Clément - SimpleRezo
RMM for OPNsense: https://srbox.simplerezo.com/

Template generation runs everytime it starts. What exactly do you want to achieve?

November 29, 2019, 12:05:10 AM #2 Last Edit: November 29, 2019, 12:07:16 AM by SimpleRezo
I need to do some different "auto-init" of the plugin (after installation), and also, I want to notify a webhook of that event.

In brief, i need to run some code when configd is started/restarted :)
And with template generation, I don't see how I can do that since it's only producing files ...
Clément - SimpleRezo
RMM for OPNsense: https://srbox.simplerezo.com/


Q2: notifications on service starts are AFAIK not possible.

Quote from: fabian on November 29, 2019, 06:41:44 AM
https://github.com/opnsense/plugins/blob/master/sysutils/apuled/+POST_INSTALL

Oh yeah, i didn't think about that option. Of course, it's not enough for what I want, but it helps, thank you.
(I will also use a basic rc.d script also for OS reboot)
Clément - SimpleRezo
RMM for OPNsense: https://srbox.simplerezo.com/