Argument are discarded in new freepbx 2.6 install

after a clean install I run ./install_amp "args"
these arguments are not used, but the default settings a used instead.
this also prevents me from using the script in an installation script.

the reason is that in line 745 the script checks if /etc/amportal.conf exist, and if not , as in the case of a fresh install, it will copy its own config file and load the arguments from there.

it should use the arguments given.

function install_freepbx(){
tar xf freepbx-2.6.0.tar.gz
rm freepbx-.tar.gz
pgrep mysql 2>&1 || /sbin/service mysqld start && chkconfig mysqld on
mysqladmin -u root password 'passw0rd’
mysqladmin create asteriskcdrdb -ppassw0rd
mysql --user=root --password=passw0rd asteriskcdrdb < /usr/src/freepbx-2.6.0/SQL/cdr_mysql_table.sql
mysqladmin create asterisk -ppassw0rd
mysql --user=root --password=passw0rd asterisk < /usr/src/freepbx-2.6.0/SQL/newinstall.sql
mysql --user=root --password=passw0rd -e"GRANT ALL PRIVILEGES ON asterisk.
TO ‘asteriskuser’@‘localhost’ IDENTIFIED BY ‘amp109’"
mysql --user=root --password=passw0rd -e"GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO ‘asteriskuser’@‘localhost’ IDENTIFIED BY ‘amp109’"
mysql --user=root --password=passw0rd -e"flush privileges"
pushd freepbx*
# asterisk must run to install freepbx
# add missing manager.conf in asterisk to allow AMI
if [ -f $FILES/manager.conf ] ; then
cp $FILES/manager.conf /etc/asterisk/
cp amp_conf/astetc/manager.conf /etc/asterisk/

nc -z 5038 || exec /usr/sbin/asterisk &

#export LD_LIBRARY_PATH=/usr/local/lib 
#exec /usr/sbin/safe_asterisk -U asterisk -G asterisk

#workaround to freepbx install bug: if you specify the args and dont have the amportal.conf file.
# freepbx cpoies its own amportal.conf and loads its values , now the args supplied.
if [ $USE_AMPORTAL_CONF -eq 0 ] ; then
sed -i 's#^[[:space:]]*collect_settings(AMP_CONF,#//collect_settings(AMP_CONF,#' install_amp
/bin/cp amportal.conf /etc
sed -i "s/pidof/\/sbin\/pidof/" install_amp
./install_amp --dbhost localhost --dbname asterisk --username asteriskuser --password amp109 --webroot /var/www/html

sed -i 's/^User.*/User asterisk/' /etc/httpd/conf/httpd.conf
sed -i 's/^Group.*/Group asterisk/' /etc/httpd/conf/httpd.conf
chown asterisk /var/lib/php/session

    wget -O /modules.tar.bz2

nc -z 5038 || exec /usr/sbin/asterisk &
amportal a ma installall
killall asterisk


fell free to file a bug if you think there is an issue, though not on version 2.6 as it is not supported.