fusionpbx.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/sh
  2. #move to script directory so all relative paths work
  3. cd "$(dirname "$0")"
  4. #includes
  5. . ./config.sh
  6. . ./colors.sh
  7. #send a message
  8. verbose "Installing FusionPBX"
  9. #install dependencies
  10. yum -y install git
  11. yum -y install ghostscript libtiff-devel libtiff-tools at
  12. #forensics tools
  13. wget https://forensics.cert.org/cert-forensics-tools-release-el7.rpm
  14. rpm -Uvh cert-forensics-tools-release*rpm
  15. yum -y --enablerepo=forensics install lame
  16. #get the branch
  17. if [ .$system_branch = .'master' ]; then
  18. verbose "Using master"
  19. BRANCH=""
  20. else
  21. 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)
  22. 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)
  23. FUSION_VERSION=$FUSION_MAJOR.$FUSION_MINOR
  24. verbose "Using version $FUSION_VERSION"
  25. BRANCH="-b $FUSION_VERSION"
  26. fi
  27. #add the cache directory
  28. mkdir -p /var/cache/fusionpbx
  29. chown -R freeswitch:daemon /var/cache/fusionpbx
  30. #get the source code
  31. git clone $BRANCH https://github.com/fusionpbx/fusionpbx.git /var/www/fusionpbx
  32. #send a message
  33. verbose "FusionPBX Installed"