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

Contents 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.2 - (show annotations) (download)
Wed Dec 7 06:52:53 2022 UTC (22 months, 3 weeks ago) by jpp
Branch: MAIN
CVS Tags: smeserver-freepbx-14-8_el7_sme, smeserver-freepbx-14-9_el7_sme, smeserver-freepbx-14-11_el7_sme, smeserver-freepbx-14-13_el7_sme, smeserver-freepbx-14-10_el7_sme, smeserver-freepbx-14-12_el7_sme, smeserver-freepbx-14-14_el7_sme, HEAD
Changes since 1.1: +3 -2 lines
* Wed Dec 07 2022 Jean-Philippe Pialasse <tests@pialasse.com> 14-8.sme
- fix patch for asterisk crontab [SME: 12227]

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,22 @@
25 +#!/bin/bash
26 +
27 +path='PATH=\/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin:\/root\/bin'
28 +cronfile='/var/spool/cron/asterisk'
29 +[ ! -f $cronfile ] && exit 0
30 +status=$(/sbin/e-smith/config getprop freepbx status || echo "disabled")
31 +
32 +# add PATH to fist line if not present; else update it
33 +sed -i "1!b;s/^PATH.*/$path/; t; 1i $path" $cronfile
34 +# remove any other occurence of PATH
35 +sed -i "1p;t; /^PATH.*/d" $cronfile
36 +
37 +# check if freepbx enabled
38 +if [[ $status == "enabled" ]]; then
39 + # if enabled uncomment
40 + sed -ri 's/^#(\@[a-zA-Z]+ .*|[0-9*]+ [0-9*]+ [0-9*]+ [0-9*]+ [0-9*]+ .*)/\1/' $cronfile
41 +else
42 + # if disabled comment out
43 + sed -ri 's/^(\@[a-zA-Z]+ .*|[0-9*]+ [0-9*]+ [0-9*]+ [0-9*]+ [0-9*]+ .*)/#\1/' $cronfile
44 +fi
45 +#remove any duplicate entry
46 +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