forked from norman/fusionpbx-install.sh-github-mirror
* devuan: pull fail2ban updates from debian installer * devuan: merge updates to postgresql.sh from debian * devuan: pull updated resources/backup scripts from debian * devuan: merge and update php installer scripts * devuan: merged changes to reset_admin_password.sh from debian * devuan: fix release name typo for chimaera * devuan: merge iptables changes from debian * devuan: merge nginx changes from debian * devuan: merge letsencrypt.sh from debian * devuan: merge main install scripts and config from debian * devuan: simplify sngrep install, its in all maintained releases * devuan: merge main install script updates from debian * devuan: finish.sh: use /usr/sbin/service for restart * devuan: postgresql.sh: fix syntax error * devuan: update and unify sysvinit setup there is no sysvinit package available from freeswitch, usethe same init and defaults file for package and source install * devuan: add equvalent debian releasesto environment.sh * devuan: merge changes to switch* from debian * devuan: switch: use os_codenam_debian to add repos * devuan: olny stop ufw if it was installed * devuan: update config.sh defaults * devuan: remove systemd-specifics from switch package installation * devuan: install postgres before freeswitch * devuan: removed libyuv-dev installation, embedded in freeswitch * devuan: fix failing move of freeswitch music * devuan: removed another libyuv-dev installation, embedded in freeswitch * devuan: revert freeswitch script dir setting in /etc/default * devuan: Enable mod_av for the install. (#389) * devuan: merge improved nginx ssl settings (#388)
64 lines
1.6 KiB
Bash
Executable File
64 lines
1.6 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" = ."stretch" ]; then
|
|
php_version=7.2
|
|
else
|
|
php_version=5.6
|
|
fi
|
|
fi
|
|
|
|
#set the version of php
|
|
if [ ."$os_codename" = ."chimaera" ]; then
|
|
php_version=7.4
|
|
fi
|
|
if [ ."$os_codename" = ."beowulf" ]; then
|
|
php_version=7.3
|
|
fi
|
|
|
|
#enable fusionpbx nginx config
|
|
cp nginx/fusionpbx /etc/nginx/sites-available/fusionpbx
|
|
|
|
#prepare socket name
|
|
if [ ."$php_version" = ."7.3" ]; then
|
|
sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php/php7.3-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
|
|
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
|
|
|
|
#restart nginx
|
|
/usr/sbin/service nginx restart
|