diff -Nur --no-dereference smeserver-freepbx-14.old/createlinks smeserver-freepbx-14/createlinks --- smeserver-freepbx-14.old/createlinks 2022-12-14 23:37:45.763000000 -0500 +++ smeserver-freepbx-14/createlinks 2022-12-15 01:54:26.822000000 -0500 @@ -3,8 +3,8 @@ use esmith::Build::CreateLinks qw(:all); # force default php to php56 -safe_symlink("/usr/bin/php56", "root/usr/sbin/php"); -safe_symlink("/usr/bin/php56", "root/usr/local/sbin/php"); +safe_symlink("/usr/bin/php74", "root/usr/sbin/php"); +safe_symlink("/usr/bin/php74", "root/usr/local/sbin/php"); #safe_symlink("../daemontools" , 'root/etc/rc.d/init.d/supervise/httpd-fpbx'); #safe_symlink("/var/service/httpd-fpbx" , 'root/service/httpd-fpbx'); @@ -21,6 +21,7 @@ templates2events("/etc/asterisk/cdr_mysql.conf", qw(freepbx-update bootstrap-console-save)); templates2events("/etc/asterisk/manager.conf", qw(freepbx-update bootstrap-console-save)); templates2events("/etc/logrotate.d/asterisk", qw(freepbx-update bootstrap-console-save)); +templates2events("/etc/odbc.ini", qw(freepbx-update bootstrap-console-save)); templates2events("/etc/httpd/conf/httpd.conf", $event); templates2events("/etc/httpd/fpbx-conf/httpd.conf", qw(freepbx-update bootstrap-console-save conf-userpanel)); templates2events("/etc/e-smith/sql/init/30freepbx_mysql_create_database", qw(freepbx-update bootstrap-console-save)); @@ -62,12 +63,13 @@ templates2events("/etc/asterisk/cdr_mysql.conf", $event); templates2events("/etc/asterisk/manager.conf", $event); templates2events("/etc/logrotate.d/asterisk", $event); +templates2events("/etc/logrotate.d/vsftpd", $event); templates2events("/etc/httpd/conf/httpd.conf", $event); templates2events("/etc/httpd/fpbx-conf/httpd.conf", $event); templates2events("/etc/e-smith/sql/init/30freepbx_mysql_create_database", $event); #templates2events("/etc/opt/remi/php56/php-fpm.d/www.conf", $event); templates2events("/opt/remi/php56/root/etc/php-fpm.d/www.conf", $event); - +templates2events("/etc/odbc.ini", $event); event_link("freepbx-checkinstall", $event, "10"); event_link("freepbx-checkinstall-backup", $event, "11"); 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 --- smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-amportal.conf 2022-03-27 23:45:44.000000000 -0400 +++ smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-amportal.conf 2022-12-15 01:50:09.007000000 -0500 @@ -1,5 +1,20 @@ #!/bin/bash +version=$(/usr/bin/xmllint --xpath 'string(/module/version)' /opt/freepbx/admin/modules/core/module.xml|cut -d. -f1) +if [[ $version -ge 15 ]] ; then +fwconsole="/sbin/e-smith/fwconsole" +$fwconsole setting DISABLE_CSS_AUTOGEN 1 +$fwconsole setting CHECKREFERER 0 +$fwconsole setting AUTHTYPE none +$fwconsole setting AMPWEBROOT /opt/freepbx +$fwconsole setting MODULEADMINWGET 1 +$fwconsole setting DYNAMICHINTS 1 +$fwconsole setting ARI_ADMIN_PASSWORD $(/sbin/e-smith/db configuration getprop freepbx AriPassword) 2>/dev/null 1>&2 +$fwconsole setting AMPMGRPASS $(/sbin/e-smith/db configuration getprop freepbx ManagerPassword) +$fwconsole setting RSSFEEDS 'http://www.freepbx.org/rss.xml' +$fwconsole setting BRAND_FREEPBX_ALT_FOOT FreePBX + +else # Change FreePBX database settings that should have come from /etc/amportal.conf, # this is a dynamic template for FreePBX > 1.9 as it update the file on the fly, and also the db FPBX_SETTING_PATH="/var/lib/asterisk/bin/freepbx_setting" @@ -13,6 +28,6 @@ $FPBX_SETTING_PATH AMPMGRPASS $(/sbin/e-smith/db configuration getprop freepbx ManagerPassword) $FPBX_SETTING_PATH RSSFEEDS 'http://www.freepbx.org/rss.xml' $FPBX_SETTING_PATH BRAND_FREEPBX_ALT_FOOT FreePBX - +fi # now regenrate the amportal.conf from mysql -/var/lib/asterisk/bin/fwconsole r +/sbin/e-smith/fwconsole r 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 --- smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-checkinstall 2022-12-14 23:37:45.781000000 -0500 +++ smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-checkinstall 2022-12-15 01:50:08.759000000 -0500 @@ -53,19 +53,32 @@ # Upgrades have to be done through freePBX and the online repository if [ ! -d /opt/freepbx/admin ]; then mkdir -p /opt/freepbx + # we need the right php version available + version=$(/usr/bin/rpm -q freepbx-src --qf "%{version}"|cut -d. -f1) + php="/usr/bin/php74" + if [[ $version -ge 16 ]] + then + php="/usr/bin/php74" + elif [[ $version -lt 15 ]] + then + php="/usr/bin/php56" + fi + ln -sf $php /usr/sbin/php + ln -sf $php /usr/local/sbin/php + if [ -e /usr/share/freepbx/sources/freepbx/ ]; then cd /usr/share/freepbx/sources/freepbx/ echo "Starting Asterisk..." > /root/freepbx_install.log ./start_asterisk start >> /root/freepbx_install.log 2>&1 echo "" >> /root/freepbx_install.log echo "Installing FreePBX..." >> /root/freepbx_install.log - echo "a" | ./install --webroot="/opt/freepbx" \ + echo "a" |$php --define sys_temp_dir=/var/spool/asterisk/tmp/ --define allow_url_fopen=1 --define memory_limit=256M /usr/share/freepbx/sources/freepbx/install --webroot="/opt/freepbx" \ --dbengine="mysql" --dbname="freepbxdb" --dbuser="freepbxuser" --dbpass="$DBPASS" -n \ --cdrdbname="$CDRDBNAME" --astmoddir=/usr/lib64/asterisk/modules/ \ --astagidir=/usr/share/asterisk/agi-bin/ --ampsbin=/usr/sbin --ampcgibin=/opt/freepbx/cgi-bin \ >> /root/freepbx_install.log 2>&1 else - echo "error: /usr/share/freepbx/sources/freepbx/ doesn't exists" + echo "error: /usr/share/freepbx/sources/freepbx/ doesn't exists" exit 1 fi else @@ -95,19 +108,21 @@ php="/usr/bin/php74" if [[ $version -ge 16 ]] then - php="/usr/bin/php80" + #version we have is not fully compatible, need newer source + php="/usr/bin/php74" elif [[ $version -lt 15 ]] then php="/usr/bin/php56" fi ln -sf $php /usr/sbin/php - +ln -sf $php /usr/local/sbin/php # update modules -/usr/sbin/e-smith/fwconsole ma upgrade framework -/usr/sbin/e-smith/fwconsole ma upgradeall -R standard -R extended -/usr/sbin/e-smith/fwconsole ma refreshsignatures -/usr/sbin/e-smith/fwconsole ma downloadinstall userman certman +/usr/sbin/e-smith/fwconsole ma upgrade framework 2>/dev/null +/usr/sbin/e-smith/fwconsole ma upgrade core 2>/dev/null +/usr/sbin/e-smith/fwconsole ma upgradeall -R standard -R extended 2>/dev/null +/usr/sbin/e-smith/fwconsole ma refreshsignatures 2>/dev/null +/usr/sbin/e-smith/fwconsole ma downloadinstall userman certman arimanager 2>/dev/null /usr/sbin/e-smith/fwconsole ma downloadinstall ucp 2>/dev/null exit 0 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 --- 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/root/etc/e-smith/templates/etc/logrotate.d/vsftpd/10info 2022-12-15 01:53:26.738000000 -0500 @@ -0,0 +1 @@ +# /var/log/xferlog already handled in /etc/logrotate.d/proftpd diff -Nur --no-dereference smeserver-freepbx-14.old/root/etc/e-smith/templates/etc/odbc.ini/10freepbx smeserver-freepbx-14/root/etc/e-smith/templates/etc/odbc.ini/10freepbx --- smeserver-freepbx-14.old/root/etc/e-smith/templates/etc/odbc.ini/10freepbx 1969-12-31 19:00:00.000000000 -0500 +++ smeserver-freepbx-14/root/etc/e-smith/templates/etc/odbc.ini/10freepbx 2022-12-15 00:06:39.445000000 -0500 @@ -0,0 +1,12 @@ +[MySQL-{ ${freepbx}{CdrDbName} || 'asteriskcdrdb' }] +Description=MySQL connection to '{ ${freepbx}{CdrDbName} || 'asteriskcdrdb' }' database +driver=MySQL +server=localhost +database={ ${freepbx}{CdrDbName} || 'asteriskcdrdb' } +Port=3306 +Socket=/var/lib/mysql/mysql.sock +option=3 +Charset=utf8 +User = { ${freepbx}{DbUser} || 'freepbxuser'} +Password = { ${freepbx}{DbPassword} || 'freepbxuser'} +