Error in pbx_first_boot.sh

Hi!

I tested install FreePBX Distro 6.12.65-10, but I had problem with instalation. Script pbx_first_boot.sh contains a few errors.
The critical part of code is below.

  1. Variable ARCH is used before it is assigned. The same problem is with variable PBXVERS. Even this variable should be probably FREEPBXVERS.
  2. The curl connect to https server and it is not possible verify certificates. Probably the option “-k” is missing -> “curl -k -s -A…”
  3. echo ${MYBRAND} > … can’t rewrite output file, when script rerun.

Even I repair this scrip and install all components, asterisk crash:

The file ‘cel_general_additional.conf’ was listed as a #include but it does not exist.
Segmentation fault

Critical part of pbx_first_boot.sh

test for internet

log_info "checking deployment"
BRAND_RETURN=$(curl -s -m 30 -A “PBXact Firstboot PBXact-${PBXVERS} ${ARCH} ${INSTALLTYPE}” } https://push2.schmoozecom.com/deployment/brand)
MYBRAND=$(echo ${BRAND_RETURN} | python -c ‘import simplejson as json,sys;obj=json.loads(sys.stdin.read());print obj[“brand”]’)
if [[ -n ${MYBRAND} ]]
then
echo ${MYBRAND} > /etc/schmooze/pbx-version
fi

log_info "Testing for internet access"
INTERFACE=$(ip route show | awk ’ /^default/ { print $5 }’)
MACADDR=$(ip -o link show ${INTERFACE} | awk ‘/link/ {print $13}’)
MACHASH=$(echo -en ${MACADDR} | md5sum - | awk ‘/-/ {print $1}’)
ARCH=$(uname -m)
FREEPBXVERS=$(head -n 1 /etc/schmooze/pbx-version)
INSTALLTYPE=$(cat /installed-version | sed -e ‘s/.kickstart-([^.]).*/\1/’)
BRAND=$(head -n 1 /etc/schmooze/pbx-brand)
UARETURN=$(curl -s -m 30 -A “FreePBX Firstboot ${BRAND}-${FREEPBXVERS} ${ARCH} ${INSTALLTYPE}” --data mac=${MACADDR} --data mhash=${MACHASH} http://kickstart.freepbxdistro.org/install-log/)

Please submit bugs to http://issues.freepbx.org