March 12, 2021, 3:18pm
Is it possible to have a bash script run when the fwconsole reload or “apply config” button is pressed?
I currently have a daily cron job that pulls user data out of the database for a phone directory and while this works, if I could have it hooked to a config reload it would be preferred.
I saw some threads about doing a custom module (which would then be called during a config reload) but that seems like a lot of overhead for what amounts to a simple mysql CSV export.
March 12, 2021, 4:40pm
A custom module doesn’t have to be overly involved
You could also just monitor files in /etc/asterisk for changes (such as extensions_additional.conf) and use that to trigger your job.
Or use a log monitoring tool like SEC to monitor the asterisk log for a reload and trigger the job.
March 12, 2021, 8:51pm
Thanks for the ideas. I’ll give them a shot!
March 12, 2021, 9:09pm
Try adding an incron job
/etc/asterisk/voicemail.conf IN_CLOSE_WRITE /your/script/name.sh
March 12, 2021, 9:26pm
There are PRE and POST reload script hooks in advanced settings.
Update to the edge framework first.
March 12, 2021, 9:46pm
I had been doing similar, because the post-reload script broke somewhere along the way and I was too lazy to file a bug report.
This post prompted me to post a report(and planned to post a PR), only to find out it was fixed in the newest edge version of Framework 18.104.22.168.
Timing is everything.
June 3, 2021, 11:10pm
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.