fusionpbx.sh 1019 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/sh
  2. #move to script directory so all relative paths work
  3. cd "$(dirname "$0")"
  4. . ./config.sh
  5. . ./colors.sh
  6. . ./environment.sh
  7. #send a message
  8. verbose "Installing FusionPBX"
  9. #install dependencies
  10. apt-get install -qq -y git dbus haveged ssl-cert
  11. apt-get install -qq -y ghostscript libtiff5-dev libtiff-tools
  12. if [ .$system_branch = "master" ]; then
  13. verbose "Using master"
  14. branch=""
  15. else
  16. 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)
  17. 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)
  18. system_version=$system_major.$system_minor
  19. verbose "Using version $system_version"
  20. branch="-b $system_version"
  21. fi
  22. #get the source code
  23. git clone $branch https://github.com/fusionpbx/fusionpbx.git /var/www/fusionpbx
  24. chown -R www-data:www-data /var/www/fusionpbx
  25. chmod -R 755 /var/www/fusionpbx/secure