Hi Sai, If by onboarding you mean the event when the device is first recognized by the system and registers itself, then we have a specific hook for it: https://github.com/openwisp/openwisp-config/#hooks, see the post registration hook.
If you are compiling from master or using the builds from downloads.openwisp.io, you can also use the new hotplug events: https://github.com/openwisp/openwisp-config/#hotplug-events That will allow you to add any logic you need. For example, you could deploy scripts via OpenWISP templates, hook them to the post config reload event, which is triggered after the new config has been applied, and execute the scripts. In case you need the scripts to run only once you just need to write a control file somewhere in the permanent flash storage (eg: /etc/openwisp) and check whether that file exists before doing anything, if it exists, you simply exit, if it doesn't you let the script proceed. It may sound obvious to some but I need to reiterate that I highly recommend to try this manually first and only once you are 100% sure that the scripts you prepared work, only then put those scripts in OpenWISP as templates and test the full flow. Some people try to do it all at once and end up bombarding us with questions which most of the time do not have to do anything with OpenWISP but with their lack of understanding of OpenWrt. Best regards *Federico Capoano* OpenWISP OÜ Harjumaa, Tallinn, Sepapaja tn 6, 15551 VAT: EE101989729 *openwisp.io* <http://openwisp.io> On Thu, Jul 28, 2022 at 8:52 AM Sai Subramanian <[email protected]> wrote: > Hi team, > > I have been working on OpenWisp for my personal research related work and > I am happy with your product. > > I have been facing a challenge the with your software, where I am not able > to create custom built templates. > > For example, I want to create a template which can run few commands on the > OpenWRT device when the onboard. Can you please guide me on how I can build > custom templates to achieve the above requirement? > > Regards, > Sai > > -- > You received this message because you are subscribed to the Google Groups > "OpenWISP" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web, visit > https://groups.google.com/d/msgid/openwisp/0f0eda32-c886-477e-8658-cedffa0dd24fn%40googlegroups.com > <https://groups.google.com/d/msgid/openwisp/0f0eda32-c886-477e-8658-cedffa0dd24fn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "OpenWISP" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web, visit https://groups.google.com/d/msgid/openwisp/CAAGgX6JoEVQo%3D8Pxw2TqGQhGnT8cgA2sMhojv6Q3TjD3w0xf1A%40mail.gmail.com.
