#!/bin/bash
version=$(/usr/bin/xmllint --xpath 'string(/module/version)' /opt/freepbx/admin/modules/core/module.xml|cut -d. -f1)
php="56"
if [[ $version -ge 16 ]]
then
  php="74"
elif [[ $version -le 15 ]]
then 
  php="56"
fi
forcephp=$(/sbin/e-smith/db configuration getprop freepbx PHPVersion 2>/dev/null || echo $php )
php=$forcephp

/usr/bin/php$php  --define sys_temp_dir=/var/spool/asterisk/tmp/ --define allow_url_fopen=1  /var/lib/asterisk/bin/fwconsole $@ 
