Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility to run a command after configuration is applied #26

Closed
gabri94 opened this issue Feb 28, 2017 · 7 comments
Closed

Add possibility to run a command after configuration is applied #26

gabri94 opened this issue Feb 28, 2017 · 7 comments

Comments

@gabri94
Copy link

gabri94 commented Feb 28, 2017

In order to use OpenWISP with LibreMesh, we need a way to call the command "lime-config" after the configuration has been fetched, but before the networking get reloaded.

I propose to add a parameter to specify a generic command in the config file.

@nemesifier
Copy link
Member

nemesifier commented Feb 28, 2017

Question: does lime-config work with a single configuration file or multiple files?

Take a look at this script that is used internally by openwisp-config: openwisp-reload-config.

It's a modified version of OpenWRT's reload-config (procd), which also explicitly calls /etc/init.d/<service> reload if necessary.

That's a way of doing it which wouldn't need to do new development.

An alternative would be to add some kind of customisable hook to call when the configuration is applied, which would also be interesting.

Could you find the source code of lime-config and link it here? I want to take a look at it but can't find it quickly.

@nemesifier nemesifier changed the title run a command when openwisp fetch the configuration Add possibility to run a command after configuration is applied Feb 28, 2017
@G10h4ck
Copy link

G10h4ck commented Mar 1, 2017

lime-config read a couple of config files and write almost everything else

@nemesifier
Copy link
Member

@G10h4ck thanks for the info, could you add the link to the source code of lime-config please?

@nemesifier
Copy link
Member

I guess the best thing is to add a generic hook to call lime-config as suggested by @gabri94. Stay tuned.

@nemesifier
Copy link
Member

Thx @gabri94 and @G10h4ck, see 033d69a. I will issue a new release later.

@nemesifier
Copy link
Member

Released openwisp-config 0.4.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants