1 |
diff -Nur --no-dereference smeserver-freepbx-14.old/createlinks smeserver-freepbx-14/createlinks |
diff -Nur --no-dereference smeserver-freepbx-14.old/createlinks smeserver-freepbx-14/createlinks |
2 |
--- smeserver-freepbx-14.old/createlinks 2022-12-14 23:37:45.763000000 -0500 |
--- smeserver-freepbx-14.old/createlinks 2022-12-14 23:37:45.763000000 -0500 |
3 |
+++ smeserver-freepbx-14/createlinks 2022-12-15 01:54:26.822000000 -0500 |
+++ smeserver-freepbx-14/createlinks 2022-12-15 02:36:42.248000000 -0500 |
4 |
@@ -3,8 +3,8 @@ |
@@ -3,8 +3,8 @@ |
5 |
use esmith::Build::CreateLinks qw(:all); |
use esmith::Build::CreateLinks qw(:all); |
6 |
|
|
12 |
|
|
13 |
#safe_symlink("../daemontools" , 'root/etc/rc.d/init.d/supervise/httpd-fpbx'); |
#safe_symlink("../daemontools" , 'root/etc/rc.d/init.d/supervise/httpd-fpbx'); |
14 |
#safe_symlink("/var/service/httpd-fpbx" , 'root/service/httpd-fpbx'); |
#safe_symlink("/var/service/httpd-fpbx" , 'root/service/httpd-fpbx'); |
15 |
@@ -21,6 +21,7 @@ |
@@ -21,10 +21,11 @@ |
16 |
templates2events("/etc/asterisk/cdr_mysql.conf", qw(freepbx-update bootstrap-console-save)); |
templates2events("/etc/asterisk/cdr_mysql.conf", qw(freepbx-update bootstrap-console-save)); |
17 |
templates2events("/etc/asterisk/manager.conf", qw(freepbx-update bootstrap-console-save)); |
templates2events("/etc/asterisk/manager.conf", qw(freepbx-update bootstrap-console-save)); |
18 |
templates2events("/etc/logrotate.d/asterisk", qw(freepbx-update bootstrap-console-save)); |
templates2events("/etc/logrotate.d/asterisk", qw(freepbx-update bootstrap-console-save)); |
20 |
templates2events("/etc/httpd/conf/httpd.conf", $event); |
templates2events("/etc/httpd/conf/httpd.conf", $event); |
21 |
templates2events("/etc/httpd/fpbx-conf/httpd.conf", qw(freepbx-update bootstrap-console-save conf-userpanel)); |
templates2events("/etc/httpd/fpbx-conf/httpd.conf", qw(freepbx-update bootstrap-console-save conf-userpanel)); |
22 |
templates2events("/etc/e-smith/sql/init/30freepbx_mysql_create_database", qw(freepbx-update bootstrap-console-save)); |
templates2events("/etc/e-smith/sql/init/30freepbx_mysql_create_database", qw(freepbx-update bootstrap-console-save)); |
23 |
@@ -62,12 +63,13 @@ |
-#templates2events("/etc/opt/remi/php56/php-fpm.d/www.conf", $event); |
24 |
|
+templates2events("/etc/opt/remi/php74/php-fpm.d/www.conf", $event); |
25 |
|
templates2events("/opt/remi/php56/root/etc/php-fpm.d/www.conf", $event); |
26 |
|
|
27 |
|
event_link("freepbx-checkinstall", $event, "10"); |
28 |
|
@@ -40,6 +41,7 @@ |
29 |
|
safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith"); |
30 |
|
safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-fpbx"); |
31 |
|
safe_symlink("reload-or-restart", "root/etc/e-smith/events/$event/services2adjust/php56-php-fpm"); |
32 |
|
+safe_symlink("reload-or-restart", "root/etc/e-smith/events/$event/services2adjust/php74-php-fpm"); |
33 |
|
|
34 |
|
safe_symlink("sigusr1", "root/etc/e-smith/events/logrotate/services2adjust/httpd-fpbx"); |
35 |
|
|
36 |
|
@@ -62,12 +64,13 @@ |
37 |
templates2events("/etc/asterisk/cdr_mysql.conf", $event); |
templates2events("/etc/asterisk/cdr_mysql.conf", $event); |
38 |
templates2events("/etc/asterisk/manager.conf", $event); |
templates2events("/etc/asterisk/manager.conf", $event); |
39 |
templates2events("/etc/logrotate.d/asterisk", $event); |
templates2events("/etc/logrotate.d/asterisk", $event); |
41 |
templates2events("/etc/httpd/conf/httpd.conf", $event); |
templates2events("/etc/httpd/conf/httpd.conf", $event); |
42 |
templates2events("/etc/httpd/fpbx-conf/httpd.conf", $event); |
templates2events("/etc/httpd/fpbx-conf/httpd.conf", $event); |
43 |
templates2events("/etc/e-smith/sql/init/30freepbx_mysql_create_database", $event); |
templates2events("/etc/e-smith/sql/init/30freepbx_mysql_create_database", $event); |
44 |
#templates2events("/etc/opt/remi/php56/php-fpm.d/www.conf", $event); |
-#templates2events("/etc/opt/remi/php56/php-fpm.d/www.conf", $event); |
45 |
|
+templates2events("/etc/opt/remi/php74/php-fpm.d/www.conf", $event); |
46 |
templates2events("/opt/remi/php56/root/etc/php-fpm.d/www.conf", $event); |
templates2events("/opt/remi/php56/root/etc/php-fpm.d/www.conf", $event); |
47 |
- |
- |
48 |
+templates2events("/etc/odbc.ini", $event); |
+templates2events("/etc/odbc.ini", $event); |
49 |
|
|
50 |
event_link("freepbx-checkinstall", $event, "10"); |
event_link("freepbx-checkinstall", $event, "10"); |
51 |
event_link("freepbx-checkinstall-backup", $event, "11"); |
event_link("freepbx-checkinstall-backup", $event, "11"); |
52 |
|
@@ -79,6 +82,7 @@ |
53 |
|
safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith"); |
54 |
|
safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-fpbx"); |
55 |
|
safe_symlink("reload-or-restart", "root/etc/e-smith/events/$event/services2adjust/php56-php-fpm"); |
56 |
|
+safe_symlink("reload-or-restart", "root/etc/e-smith/events/$event/services2adjust/php74-php-fpm"); |
57 |
|
#action needed in case we have a systemd unit |
58 |
|
event_link("systemd-default", $event, "88"); |
59 |
|
event_link("systemd-reload", $event, "89"); |
60 |
diff -Nur --no-dereference smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-amportal.conf smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-amportal.conf |
diff -Nur --no-dereference smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-amportal.conf smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-amportal.conf |
61 |
--- smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-amportal.conf 2022-03-27 23:45:44.000000000 -0400 |
--- smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-amportal.conf 2022-03-27 23:45:44.000000000 -0400 |
62 |
+++ smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-amportal.conf 2022-12-15 01:50:09.007000000 -0500 |
+++ smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-amportal.conf 2022-12-15 03:13:57.868000000 -0500 |
63 |
@@ -1,5 +1,20 @@ |
@@ -1,5 +1,20 @@ |
64 |
#!/bin/bash |
#!/bin/bash |
65 |
|
|
92 |
+/sbin/e-smith/fwconsole r |
+/sbin/e-smith/fwconsole r |
93 |
diff -Nur --no-dereference smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-checkinstall smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-checkinstall |
diff -Nur --no-dereference smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-checkinstall smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-checkinstall |
94 |
--- smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-checkinstall 2022-12-14 23:37:45.781000000 -0500 |
--- smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-checkinstall 2022-12-14 23:37:45.781000000 -0500 |
95 |
+++ smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-checkinstall 2022-12-15 01:50:08.759000000 -0500 |
+++ smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-checkinstall 2022-12-15 03:13:57.660000000 -0500 |
96 |
@@ -53,19 +53,32 @@ |
@@ -53,19 +53,32 @@ |
97 |
# Upgrades have to be done through freePBX and the online repository |
# Upgrades have to be done through freePBX and the online repository |
98 |
if [ ! -d /opt/freepbx/admin ]; then |
if [ ! -d /opt/freepbx/admin ]; then |
99 |
mkdir -p /opt/freepbx |
mkdir -p /opt/freepbx |
100 |
+ # we need the right php version available |
+ # we need the right php version available |
101 |
+ version=$(/usr/bin/rpm -q freepbx-src --qf "%{version}"|cut -d. -f1) |
+ version=$(/usr/bin/rpm -q freepbx-src --qf "%{version}"|cut -d. -f1) |
102 |
+ php="/usr/bin/php74" |
+ php="/usr/bin/php56" |
103 |
+ if [[ $version -ge 16 ]] |
+ if [[ $version -ge 16 ]] |
104 |
+ then |
+ then |
105 |
+ php="/usr/bin/php74" |
+ php="/usr/bin/php74" |
106 |
+ elif [[ $version -lt 15 ]] |
+ elif [[ $version -le 15 ]] |
107 |
+ then |
+ then |
108 |
+ php="/usr/bin/php56" |
+ php="/usr/bin/php56" |
109 |
+ fi |
+ fi |
128 |
exit 1 |
exit 1 |
129 |
fi |
fi |
130 |
else |
else |
131 |
@@ -95,19 +108,21 @@ |
@@ -92,22 +105,26 @@ |
132 |
php="/usr/bin/php74" |
ln -sf /usr/sbin/e-smith/fwconsole /usr/sbin/fwconsole |
133 |
|
ln -sf /usr/sbin/e-smith/fwconsole /usr/local/sbin/fwconsole |
134 |
|
version=$(/usr/bin/xmllint --xpath 'string(/module/version)' /opt/freepbx/admin/modules/core/module.xml|cut -d. -f1) |
135 |
|
-php="/usr/bin/php74" |
136 |
|
+php="56" |
137 |
if [[ $version -ge 16 ]] |
if [[ $version -ge 16 ]] |
138 |
then |
then |
139 |
- php="/usr/bin/php80" |
- php="/usr/bin/php80" |
140 |
|
-elif [[ $version -lt 15 ]] |
141 |
+ #version we have is not fully compatible, need newer source |
+ #version we have is not fully compatible, need newer source |
142 |
+ php="/usr/bin/php74" |
+ php="74" |
143 |
elif [[ $version -lt 15 ]] |
+elif [[ $version -le 15 ]] |
144 |
then |
then |
145 |
php="/usr/bin/php56" |
- php="/usr/bin/php56" |
146 |
|
+ php="56" |
147 |
fi |
fi |
148 |
ln -sf $php /usr/sbin/php |
-ln -sf $php /usr/sbin/php |
149 |
- |
- |
150 |
+ln -sf $php /usr/local/sbin/php |
+forcephp=$(/sbin/e-smith/db configuration getprop freepbx PHPVersion || echo $php ) |
151 |
|
+php=$forcephp |
152 |
|
+ln -sf /usr/bin/php$php /usr/sbin/php |
153 |
|
+ln -sf /usr/bin/php$php /usr/local/sbin/php |
154 |
|
|
155 |
# update modules |
# update modules |
156 |
-/usr/sbin/e-smith/fwconsole ma upgrade framework |
-/usr/sbin/e-smith/fwconsole ma upgrade framework |
167 |
exit 0 |
exit 0 |
168 |
diff -Nur --no-dereference smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-checkinstall-backup smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-checkinstall-backup |
diff -Nur --no-dereference smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-checkinstall-backup smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-checkinstall-backup |
169 |
--- smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-checkinstall-backup 2022-12-14 23:37:45.782000000 -0500 |
--- smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-checkinstall-backup 2022-12-14 23:37:45.782000000 -0500 |
170 |
+++ smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-checkinstall-backup 2022-12-15 02:05:02.315000000 -0500 |
+++ smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-checkinstall-backup 2022-12-15 03:13:58.104000000 -0500 |
171 |
@@ -56,6 +56,16 @@ |
@@ -56,6 +56,16 @@ |
172 |
if [ -z $backupid ] ; then |
if [ -z $backupid ] ; then |
173 |
backupid=$(/usr/bin/uuidgen) |
backupid=$(/usr/bin/uuidgen) |
194 |
# set first backup as the one for SME way |
# set first backup as the one for SME way |
195 |
# set destination |
# set destination |
196 |
mysql -e "use $DBNAME;UPDATE backup_server_details set value = '/home/e-smith/files/freepbx' WHERE server_id = 1;" |
mysql -e "use $DBNAME;UPDATE backup_server_details set value = '/home/e-smith/files/freepbx' WHERE server_id = 1;" |
197 |
|
diff -Nur --no-dereference smeserver-freepbx-14.old/root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/90FreePBX20Root smeserver-freepbx-14/root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/90FreePBX20Root |
198 |
|
--- smeserver-freepbx-14.old/root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/90FreePBX20Root 2022-12-14 23:37:45.768000000 -0500 |
199 |
|
+++ smeserver-freepbx-14/root/etc/e-smith/templates/etc/httpd/fpbx-conf/httpd.conf/90FreePBX20Root 2022-12-15 03:14:11.029000000 -0500 |
200 |
|
@@ -4,7 +4,7 @@ |
201 |
|
{ |
202 |
|
my $key = "freepbx"; |
203 |
|
my $pool_name = lc $key; |
204 |
|
- my $version = 56; |
205 |
|
+ my $version = ( $freepbx{PHPVersion} eq '74' )? '74' : '56'; |
206 |
|
$OUT .=" |
207 |
|
<FilesMatch .php\$> |
208 |
|
SetHandler \"proxy:unix:/var/run/php-fpm/php${version}-${pool_name}.sock|fcgi://localhost\" |
209 |
diff -Nur --no-dereference smeserver-freepbx-14.old/root/etc/e-smith/templates/etc/logrotate.d/vsftpd/10info smeserver-freepbx-14/root/etc/e-smith/templates/etc/logrotate.d/vsftpd/10info |
diff -Nur --no-dereference smeserver-freepbx-14.old/root/etc/e-smith/templates/etc/logrotate.d/vsftpd/10info smeserver-freepbx-14/root/etc/e-smith/templates/etc/logrotate.d/vsftpd/10info |
210 |
--- smeserver-freepbx-14.old/root/etc/e-smith/templates/etc/logrotate.d/vsftpd/10info 1969-12-31 19:00:00.000000000 -0500 |
--- smeserver-freepbx-14.old/root/etc/e-smith/templates/etc/logrotate.d/vsftpd/10info 1969-12-31 19:00:00.000000000 -0500 |
211 |
+++ smeserver-freepbx-14/root/etc/e-smith/templates/etc/logrotate.d/vsftpd/10info 2022-12-15 01:53:26.738000000 -0500 |
+++ smeserver-freepbx-14/root/etc/e-smith/templates/etc/logrotate.d/vsftpd/10info 2022-12-15 01:53:26.738000000 -0500 |
227 |
+User = { ${freepbx}{DbUser} || 'freepbxuser'} |
+User = { ${freepbx}{DbUser} || 'freepbxuser'} |
228 |
+Password = { ${freepbx}{DbPassword} || 'freepbxuser'} |
+Password = { ${freepbx}{DbPassword} || 'freepbxuser'} |
229 |
+ |
+ |
230 |
|
diff -Nur --no-dereference smeserver-freepbx-14.old/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/16freepbx smeserver-freepbx-14/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/16freepbx |
231 |
|
--- smeserver-freepbx-14.old/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/16freepbx 2022-03-27 23:45:44.000000000 -0400 |
232 |
|
+++ smeserver-freepbx-14/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/16freepbx 2022-12-15 03:14:15.561000000 -0500 |
233 |
|
@@ -1,6 +1,7 @@ |
234 |
|
{ |
235 |
|
|
236 |
|
-if ($PHP_VERSION eq '56'){ |
237 |
|
+my $PHPVersion = ( $freepbx{PHPVersion} eq '74' )? '74' : '56'; |
238 |
|
+if ($PHP_VERSION eq $PHPVersion){ |
239 |
|
if (($freepbx{'status'} || 'disabled') eq 'enabled'){ |
240 |
|
my $max_upload_size = ($freepbx{MaxUploadSize} || '100M'); |
241 |
|
$max_upload_size .= 'M' if ($max_upload_size =~ m/^\d+$/); |
242 |
|
diff -Nur --no-dereference smeserver-freepbx-14.old/root/sbin/e-smith/fwconsole smeserver-freepbx-14/root/sbin/e-smith/fwconsole |
243 |
|
--- smeserver-freepbx-14.old/root/sbin/e-smith/fwconsole 2022-12-14 23:37:45.782000000 -0500 |
244 |
|
+++ smeserver-freepbx-14/root/sbin/e-smith/fwconsole 2022-12-15 03:14:02.205000000 -0500 |
245 |
|
@@ -1,12 +1,14 @@ |
246 |
|
#!/bin/bash |
247 |
|
version=$(/usr/bin/xmllint --xpath 'string(/module/version)' /opt/freepbx/admin/modules/core/module.xml|cut -d. -f1) |
248 |
|
-php="/usr/bin/php74" |
249 |
|
+php="56" |
250 |
|
if [[ $version -ge 16 ]] |
251 |
|
then |
252 |
|
- php="/usr/bin/php80" |
253 |
|
-elif [[ $version -lt 15 ]] |
254 |
|
+ php="74" |
255 |
|
+elif [[ $version -le 15 ]] |
256 |
|
then |
257 |
|
- php="/usr/bin/php56" |
258 |
|
+ php="56" |
259 |
|
fi |
260 |
|
+forcephp=$(/sbin/e-smith/db configuration getprop freepbx PHPVersion || echo $php ) |
261 |
|
+php=$forcephp |
262 |
|
|
263 |
|
-$php --define sys_temp_dir=/var/spool/asterisk/tmp/ --define allow_url_fopen=1 /var/lib/asterisk/bin/fwconsole $@ |
264 |
|
+/usr/bin/php$php --define sys_temp_dir=/var/spool/asterisk/tmp/ --define allow_url_fopen=1 /var/lib/asterisk/bin/fwconsole $@ |