#!/bin/bash
# Install PBX in a Flash on existing CentOS server by Jonathan Roper.
# Copyright (C) <2010> <Star2Billing SL>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# [email protected]
#
#Variables
KERNELARCH=$(uname -p)
#Change the next three lines to suit download location of latest PBX in a Flash ISO's
PIAFLOC64=http://ignum2.dl.sourceforge.net/project/pbxinaflash/PIAF-1.7.5.5.3-CentOS-5.5-64bit/pbxinaflash-x86_64-17553.iso
PIAFLOC32=http://mesh.dl.sourceforge.net/project/pbxinaflash/PIAF-1.7.5.5.3-CentOS-5.5-32bit/pbxinaflash-17553.iso
PIAFVERS=1.7.5.5.3
#Identify the Architecture.
KERNELARCH=$(uname -p)
rm -rf pbxinaflash*.iso
#Download apporpriate ISO.
cd /tmp
if [ $KERNELARCH = "x86_64" ]; then
wget $PIAFLOC64
else
wget $PIAFLOC32
fi
#Mount it
mkdir /mnt/piaf
mount -o loop /tmp/pbxinaflash*.iso /mnt/piaf/
#Install the contents of the CD
cd /mnt/piaf/pbx/
yum --nogpgcheck --skip-broken localinstall *.rpm
#Make the ISO look like a PiaF, but don't start the install on reboot
/usr/sbin/ntpdate -su pool.ntp.org
mkdir -p /etc/pbx
date --iso-8601=minutes > /etc/pbx/install-date
echo "ISO=$PIAFVERS" > /etc/pbx/ISO-Version
echo "method=pbx=$PIAFVERS ks - existing CentOS install" > /etc/pbx/install-method
#Don't install automatically, because you won't see or be able to interact with the screen!
#echo "/usr/local/sbin/piafdl" >> /etc/rc.d/rc3.d/S99local
cp -f /usr/src/piafxtras/preinstallmenu/piafxtras-menu /usr/local/sbin/piafxtras-menu
chmod +x /usr/local/sbin/piafxtras-menu
cat /usr/src/piafxtras/preinstallmenu/motd.tmp >/etc/motd
#Clean Up
#Disable SELINUX
sed -i 's/=enforcing/=disabled/g' /etc/sysconfig/selinux
cd ~
umount /mnt/piaf/
rm -rf /mnt/pbx/
rm -rf /tmp/pbxinaflash*.iso
#May as well start with an up-to-date system.
yum -y update
#Now reboot
clear
echo "Please reboot your system."
echo "then type piafdl when you next logon..."
echo "to install PBX in a Flash."
***********************************************************
The existing menuselect.makeopts file did not specify
that 'app_dahdibarge' should not be included. However, either some
dependencies for this module were not found or a
conflict exists.
Either run 'make menuselect' or remove the existing
menuselect.makeopts file to resolve this issue.
***********************************************************
make[2]: Leaving directory `/usr/src/dahdi/linux/drivers/dahdi/firmware'
You do not appear to have the sources for the 2.6.18-194.8.1.el5.028stab070.5 kernel installed.
make[1]: *** [modules] Error 1
make[1]: Leaving directory `/usr/src/dahdi/linux'
make: *** [all] Error 2
/var/pbx_load/ast18xtras/menuselect.makeopts' -> `/usr/src/asterisk/menuselect.makeopts'
Link up your team and customers Phone System Live Chat Video Conferencing
Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.
Check your inbox!
We’ve sent you an email. Click on the button in the email body to verify your email address – (if you can not find it, check your spam folder).
Upon verification you will be directed to the 3CX setup wizard.