fusionpbx-install.sh/debian/resources/fusionpbx.sh

41 lines
1.4 KiB
Bash
Raw Normal View History

2016-04-29 21:24:22 +02:00
#!/bin/sh
#move to script directory so all relative paths work
cd "$(dirname "$0")"
. ./colors.sh
. ./arguments.sh
2016-04-29 21:24:22 +02:00
#send a message
verbose "Installing FusionPBX"
2016-04-29 21:24:22 +02:00
#install dependencies
2016-05-13 23:02:36 +02:00
apt-get install -y --force-yes vim git dbus haveged ssl-cert
2016-04-29 21:24:22 +02:00
apt-get install -y --force-yes ghostscript libtiff5-dev libtiff-tools
2016-11-26 06:17:09 +01:00
if [ $USE_SYSTEM_MASTER = true ]; then
verbose "Using master"
BRANCH=""
else
FUSION_MAJOR=$(git ls-remote --heads https://github.com/fusionpbx/fusionpbx.git | cut -d/ -f 3 | grep -P '^\d+\.\d+' | sort | tail -n 1 | cut -d. -f1)
FUSION_MINOR=$(git ls-remote --tags https://github.com/fusionpbx/fusionpbx.git $FUSION_MAJOR.* | cut -d/ -f3 | grep -P '^\d+\.\d+' | sort | tail -n 1 | cut -d. -f2)
FUSION_VERSION=$FUSION_MAJOR.$FUSION_MINOR
verbose "Using version $FUSION_VERSION"
BRANCH="-b $FUSION_VERSION"
fi
2016-04-29 21:24:22 +02:00
#get the source code
git clone $BRANCH https://github.com/fusionpbx/fusionpbx.git /var/www/fusionpbx
2016-04-29 21:24:22 +02:00
chown -R www-data:www-data /var/www/fusionpbx
2016-09-15 22:14:32 +02:00
chmod -R 755 /var/www/fusionpbx/secure
2017-01-05 04:22:09 +01:00
#create the /etc/fusionpbx directory and copy the config.php into it
#mkdir -p /etc/fusionpbx
#chown -R www-data:www-data /etc/fusionpbx
#cp fusionpbx/config.php /etc/fusionpbx
#sed -i /etc/fusionpbx/config.php -e s:'{database_username}:fusionpbx:'
#sed -i /etc/fusionpbx/config.php -e s:'{database_password}:1234:'
2017-01-05 12:03:31 +01:00
#add the database schema
2017-01-05 12:10:39 +01:00
#cd /var/www/fusionpbx && php /var/www/fusionpbx/core/upgrade/upgrade_schema.php > /dev/null 2>&1