smeserver-freepbx/root/etc/e-smith/events/actions/freepbx-amportal.conf

34 lines
1.6 KiB
Bash

#!/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"
$FPBX_SETTING_PATH DISABLE_CSS_AUTOGEN 1
$FPBX_SETTING_PATH CHECKREFERER 0
$FPBX_SETTING_PATH AUTHTYPE none
$FPBX_SETTING_PATH AMPWEBROOT /opt/freepbx
$FPBX_SETTING_PATH MODULEADMINWGET 1
$FPBX_SETTING_PATH DYNAMICHINTS 1
$FPBX_SETTING_PATH ARI_ADMIN_PASSWORD $(/sbin/e-smith/db configuration getprop freepbx AriPassword)
$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
/sbin/e-smith/fwconsole r