2016-04-29 21:24:22 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
2016-09-29 18:57:50 +02:00
|
|
|
#move to script directory so all relative paths work
|
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
|
|
2016-10-01 00:59:58 +02:00
|
|
|
. ./colors.sh
|
2016-09-29 18:57:50 +02:00
|
|
|
. ./arguments.sh
|
|
|
|
|
|
2016-04-29 21:24:22 +02:00
|
|
|
#send a message
|
2016-09-29 18:57:50 +02:00
|
|
|
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-07 16:17:58 +01:00
|
|
|
if [ $USE_SYSTEM_MASTER == false ]; then
|
2016-09-29 18:57:50 +02:00
|
|
|
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"
|
|
|
|
|
else
|
|
|
|
|
verbose "Using master"
|
|
|
|
|
BRANCH=""
|
|
|
|
|
fi
|
|
|
|
|
|
2016-04-29 21:24:22 +02:00
|
|
|
#get the source code
|
2016-09-29 18:57:50 +02:00
|
|
|
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
|