#!/bin/bash
version=$(/usr/bin/xmllint --xpath 'string(/module/version)' /opt/freepbx/admin/modules/core/module.xml|cut -d. -f1)
php="/usr/bin/php74"
if [[ $version -ge 16 ]]
then
  php="/usr/bin/php80"
elif [[ $version -lt 15 ]]
then 
  php="/usr/bin/php56"
fi

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