forked from norman/fusionpbx-install.sh-github-mirror
- Added optional applications.sh scripts. - Added call_recordings.php script for wav - mp3 conversion. - Updated ubuntu\resources\fusionpbx\config.conf to add entry for setting the event socket password and a comment at the top to direct admins to where they can find more configuration options for this file. - Updated config.sh to add switch_token entry and some version changes to make the installer Ubuntu 24.04 compatible. - Added on the Optional applications. - Updated environment.sh to include setting the PATH just in case. - Updated finish.sh to include output of database username and password to save a few steps when setting up. - Added freeswitch-acl.conf from the Debian side as more security is important. - Updated jail.local to include freeswitch-acl as well as turning several items on by default (security should always be the default). - Updated install.sh to include some missing dependencies (nginx and build-essential) - Updated php.sh, and nginx.sh to include 8.1, 8.2 and 8.3 - Swapped plocate for mlocate in dependency install in ubuntu\resources\switch\source-release.sh - uncommented ./bootstrap.sh -j line for git compatibility - removed duplicate $switch_version from sed commands, added sed command to disable mod_av. - Added environment.sh include to switch.sh - Added monit files for freeswitch perms etc.
77 lines
2.3 KiB
Bash
Executable File
77 lines
2.3 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
#move to script directory so all relative paths work
|
|
cd "$(dirname "$0")"
|
|
|
|
#includes
|
|
. ./config.sh
|
|
. ./colors.sh
|
|
. ./environment.sh
|
|
|
|
#send a message
|
|
verbose "Installing the web server"
|
|
|
|
#change the version of php for arm
|
|
if [ ."$cpu_architecture" = ."arm" ]; then
|
|
#Pi2 and Pi3 Raspbian
|
|
#Odroid
|
|
if [ ."$os_codename" = ."focal" ]; then
|
|
php_version=7.4
|
|
else
|
|
php_version=5.6
|
|
fi
|
|
fi
|
|
|
|
#enable fusionpbx nginx config
|
|
cp nginx/fusionpbx /etc/nginx/sites-available/fusionpbx
|
|
|
|
#prepare socket name
|
|
if [ ."$php_version" = ."5.6" ]; then
|
|
sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php5-fpm.sock;#g'
|
|
fi
|
|
if [ ."$php_version" = ."7.0" ]; then
|
|
sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php/php7.0-fpm.sock;#g'
|
|
fi
|
|
if [ ."$php_version" = ."7.1" ]; then
|
|
sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php/php7.1-fpm.sock;#g'
|
|
fi
|
|
if [ ."$php_version" = ."7.2" ]; then
|
|
sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php/php7.2-fpm.sock;#g'
|
|
fi
|
|
if [ ."$php_version" = ."7.4" ]; then
|
|
sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php/php7.4-fpm.sock;#g'
|
|
fi
|
|
if [ ."$php_version" = ."8.1" ]; then
|
|
sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php/php8.1-fpm.sock;#g'
|
|
fi
|
|
if [ ."$php_version" = ."8.2" ]; then
|
|
sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php/php8.2-fpm.sock;#g'
|
|
fi
|
|
if [ ."$php_version" = ."8.3" ]; then
|
|
sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php/php8.3-fpm.sock;#g'
|
|
fi
|
|
ln -s /etc/nginx/sites-available/fusionpbx /etc/nginx/sites-enabled/fusionpbx
|
|
|
|
#self signed certificate
|
|
ln -s /etc/ssl/private/ssl-cert-snakeoil.key /etc/ssl/private/nginx.key
|
|
ln -s /etc/ssl/certs/ssl-cert-snakeoil.pem /etc/ssl/certs/nginx.crt
|
|
|
|
#remove the default site
|
|
rm /etc/nginx/sites-enabled/default
|
|
|
|
#update config if LetsEncrypt folder is unwanted
|
|
if [ .$letsencrypt_folder = .false ]; then
|
|
sed -i '151,155d' /etc/nginx/sites-available/fusionpbx
|
|
fi
|
|
|
|
#add the letsencrypt directory
|
|
if [ .$letsencrypt_folder = .true ]; then
|
|
mkdir -p /var/www/letsencrypt/
|
|
fi
|
|
|
|
#flush systemd cache
|
|
systemctl daemon-reload
|
|
|
|
#restart nginx
|
|
service nginx restart
|