/[smecontribs]/rpms/smeserver-freepbx/contribs10/smeserver-freepbx-14-bz11940-bz9756-cron.patch
ViewVC logotype

Annotation of /rpms/smeserver-freepbx/contribs10/smeserver-freepbx-14-bz11940-bz9756-cron.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Sun Apr 17 01:46:29 2022 UTC (2 years, 6 months ago) by jpp
Branch: MAIN
CVS Tags: smeserver-freepbx-14-5_el7_sme, smeserver-freepbx-14-3_el7_sme, smeserver-freepbx-14-6_el7_sme, smeserver-freepbx-14-4_el7_sme, smeserver-freepbx-14-7_el7_sme, smeserver-freepbx-14-2_el7_sme
* Sat Apr 16 2022 Jean-Philippe Pialasse <tests@pialasse.com> %{version}-2.sme
- fix huge amount of error if asterisk disabled [SME: 9756]
- fix multiple email sent because of asterisk cron php path [SME: 11940]

1 jpp 1.1 diff -Nur --no-dereference smeserver-freepbx-14.old/createlinks smeserver-freepbx-14/createlinks
2     --- smeserver-freepbx-14.old/createlinks 2022-03-27 23:45:44.000000000 -0400
3     +++ smeserver-freepbx-14/createlinks 2022-04-16 21:38:51.027000000 -0400
4     @@ -31,6 +31,8 @@
5     event_link("freepbx-checkinstall-backup", $event, "11");
6     event_link("freepbx-amportal.conf", $event, "91");
7     event_link("freepbx-clean-crontab", $event, "40");
8     +event_link("freepbx-cron", $event, "40");
9     +
10     event_link("freepbx-dump-astdb", "pre-backup", "30");
11     event_link("freepbx-backup", "pre-backup", "31");
12    
13     @@ -71,6 +73,7 @@
14     event_link("freepbx-checkinstall-backup", $event, "11");
15     event_link("freepbx-amportal.conf", $event, "91");
16     event_link("freepbx-clean-crontab", $event, "40");
17     +event_link("freepbx-cron", $event, "40");
18    
19     safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mysql.init");
20     safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith");
21     diff -Nur --no-dereference smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-cron smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-cron
22     --- smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-cron 1969-12-31 19:00:00.000000000 -0500
23     +++ smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-cron 2022-04-16 21:36:24.262000000 -0400
24     @@ -0,0 +1,21 @@
25     +#!/bin/bash
26     +
27     +path='PATH=\/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin:\/root\/bin'
28     +cronfile='/var/spool/cron/asterisk2'
29     +status=$(/sbin/e-smith/config getprop freepbx status || echo "disabled")
30     +
31     +# add PATH to fist line if not present; else update it
32     +sed -i "1!b;s/^PATH.*/$path/; t; 1i $path" $cronfile
33     +# remove any other occurence of PATH
34     +sed -i "1p;t; /^PATH.*/d" $cronfile
35     +
36     +# check if freepbx enabled
37     +if [[ $status == "enabled" ]]; then
38     + # if enabled uncomment
39     + sed -ri 's/^#(\@[a-zA-Z]+ .*|[0-9*]+ [0-9*]+ [0-9*]+ [0-9*]+ [0-9*]+ .*)/\1/' $cronfile
40     +else
41     + # if disabled comment out
42     + sed -ri 's/^(\@[a-zA-Z]+ .*|[0-9*]+ [0-9*]+ [0-9*]+ [0-9*]+ [0-9*]+ .*)/#\1/' $cronfile
43     +fi
44     +#remove any duplicate entry
45     +awk '!x[$0]++' ${cronfile} >${cronfile}-tmp && cat ${cronfile}-tmp > ${cronfile} && rm -f ${cronfile}-tmp

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed