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

33 lines
1.0 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")"
2017-04-23 09:49:16 +02:00
#includes
2017-03-04 20:51:05 +01:00
. ./config.sh
. ./colors.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
2018-08-10 03:32:26 +02:00
apt-get install -y --force-yes vim git dbus haveged ssl-cert qrencode
2017-06-10 19:50:59 +02:00
apt-get install -y --force-yes ghostscript libtiff5-dev libtiff-tools at
2016-04-29 21:24:22 +02:00
2017-04-23 09:44:41 +02:00
#get the branch
2017-05-10 21:56:24 +02:00
if [ .$system_branch = .'master' ]; then
verbose "Using master"
2017-03-04 21:44:28 +01:00
branch=""
else
2017-03-04 21:44:28 +01:00
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
verbose "Using version $system_version"
branch="-b $system_version"
fi
2016-04-29 21:24:22 +02:00
#get the source code
2017-03-04 21:44:28 +01: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