Fix the fusionpbx git pull

This commit is contained in:
Mark J Crane
2017-03-26 13:24:16 -06:00
parent 3d9287de66
commit c83134b436
3 changed files with 8 additions and 13 deletions

View File

@@ -5,27 +5,23 @@ cd "$(dirname "$0")"
. ./config.sh
. ./colors.sh
. ./environment.sh
#send a message
verbose "Installing FusionPBX"
#install dependencies
apt-get install -y --force-yes vim git dbus haveged ssl-cert
apt-get install -y --force-yes ghostscript libtiff5-dev libtiff-tools
pkg install --yes git ghostscript9-base tiff
if [ .$system_branch = "master" ]; then
verbose "Using master"
branch=""
else
system_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)
system_minor=$(git ls-remote --tags https://github.com/fusionpbx/fusionpbx.git $system_major.* | cut -d/ -f3 | grep -P '^\d+\.\d+' | sort | tail -n 1 | cut -d. -f2)
system_version=$system_major.$system_minor
system_version=4.2
verbose "Using version $system_version"
branch="-b $system_version"
fi
#get the source code
git clone $branch https://github.com/fusionpbx/fusionpbx.git /var/www/fusionpbx
chown -R www-data:www-data /var/www/fusionpbx
chown -R www:www /var/www/fusionpbx
chmod -R 755 /var/www/fusionpbx/secure