Merge de886e6c98 into 08689f192f
This commit is contained in:
commit
cbd7e86c9c
|
|
@ -1,38 +1,76 @@
|
|||
#!/bin/sh
|
||||
# check to confirm running as root. # First, we need to be root...
|
||||
if [ "$(id -u)" -ne "0" ]; then
|
||||
sudo -p "$(basename "$0") must be run as root, please enter your sudo password : " "$0" "$@"
|
||||
exit 0
|
||||
fi
|
||||
echo
|
||||
echo "You're root.... continuing!"
|
||||
echo
|
||||
|
||||
#Update Debian
|
||||
echo "Update Debian"
|
||||
apt-get upgrade && apt-get update -y --force-yes
|
||||
# removes the cd img from the /etc/apt/sources.list file (not needed after base install)
|
||||
sed -i '/cdrom:/d' /etc/apt/sources.list
|
||||
|
||||
#IPTables
|
||||
resources/./iptables.sh
|
||||
#if lsb_release is not installed it installs it
|
||||
if [ ! -s /usr/bin/lsb_release ]; then
|
||||
apt-get update && apt-get -y install lsb-release
|
||||
fi
|
||||
|
||||
#FusionPBX
|
||||
resources/./fusionpbx.sh
|
||||
#Os/Distro Check
|
||||
lsb_release -c |grep -i jessie > /dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
echo " OK you are running Debian 8 : Jessie. This script is known to work "
|
||||
echo " with building from source. No Jessie pkgs yet. "
|
||||
else
|
||||
echo " This script was written for Debian 8 Jessie (Stable) "
|
||||
echo " Your OS appears to be: " lsb_release -a
|
||||
echo " Your OS is not currently supported... Exiting the install. "
|
||||
exit
|
||||
fi
|
||||
clear
|
||||
|
||||
#NGINX web server
|
||||
resources/./nginx.sh
|
||||
|
||||
#Fail2ban
|
||||
resources/./fail2ban.sh
|
||||
#
|
||||
#Update Debian & install ntpd
|
||||
for i in update upgrade ;do apt-get -y "${i}" ; done
|
||||
apt-get -y install ntp
|
||||
service ntp res
|
||||
|
||||
#FreeSWITCH
|
||||
resources/switch/./package-release.sh
|
||||
#resources/switch/./package-master.sh
|
||||
#resources/switch/./source-release.sh
|
||||
|
||||
#Postgres
|
||||
resources/./postgres.sh
|
||||
#NGINX web server
|
||||
resources/./nginx.sh
|
||||
|
||||
#FusionPBX
|
||||
resources/./fusionpbx.sh
|
||||
|
||||
#FusionPBX Optional Pkgs
|
||||
resources/./packages.sh
|
||||
|
||||
#FusionPBX Phone Provisioning Selections
|
||||
resources/./provision.sh
|
||||
|
||||
#Fail2ban
|
||||
resources/./fail2ban.sh
|
||||
|
||||
#Postgres-Client
|
||||
#resources/./postgres-client.sh
|
||||
|
||||
#Postgres-server
|
||||
#resources/./postgres-server.sh
|
||||
|
||||
#IPTables
|
||||
resources/./iptables.sh
|
||||
|
||||
#set the ip address
|
||||
server_address=$(hostname -I)
|
||||
|
||||
#restart services
|
||||
/bin/systemctl daemon-reload
|
||||
/bin/systemctl try-restart freeswitch
|
||||
/bin/systemctl daemon-reload
|
||||
/bin/systemctl restart nginx
|
||||
/bin/systemctl restart fail2ban
|
||||
systemctl daemon-reload
|
||||
systemctl restart nginx
|
||||
systemctl restart fail2ban
|
||||
#/usr/sbin/service nginx restart
|
||||
#/usr/sbin/service fail2ban restart
|
||||
|
||||
|
|
@ -45,3 +83,4 @@ echo ""
|
|||
|
||||
#wait for the config.php to exist and then restart the service
|
||||
#resources/./finish.sh
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
#######################################
|
||||
#Setup Main debian repo for right pkgs
|
||||
#######################################
|
||||
echo "installing jessie release repo"
|
||||
cat > "/etc/apt/sources.list" << DELIM
|
||||
deb http://httpredir.debian.org/debian/ jessie main contrib non-free
|
||||
deb-src http://httpredir.debian.org/debian/ jessie main contrib non-free
|
||||
|
||||
deb http://httpredir.debian.org/debian/ jessie-updates main contrib non-free
|
||||
deb-src http://httpredir.debian.org/debian/ jessie-updates main contrib non-free
|
||||
|
||||
deb http://httpredir.debian.org/debian/ jessie-backports main contrib non-free
|
||||
deb-src http://httpredir.debian.org/debian/ jessie-backports main contrib non-free
|
||||
DELIM
|
||||
|
||||
####################################
|
||||
#----- upgrading base install-----
|
||||
####################################
|
||||
apt-get update && apt-get -y upgrade
|
||||
|
|
@ -25,3 +25,4 @@ done
|
|||
#restart freeswitch
|
||||
/bin/systemctl daemon-reload
|
||||
/bin/systemctl restart freeswitch
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,96 @@
|
|||
adminer="y" # : integrated for an administrator in the superadmin group to enable easy database access
|
||||
backup="y" # : pbx backup module. backup sqlite db / configs/ logs
|
||||
call_broadcast="n" # : Create a recording and select one or more groups to have the system call and play the recording
|
||||
call_center="y" # : display queue status, agent status, tier status for call centers using mod_callcenter call queues
|
||||
call_flows="n" # : Typically used with day night mode. To direct calls between two destinations.
|
||||
conference_centers="n" # : tools for multi room confrences and room contol
|
||||
conferences="n" # : tools for single room confrences and room contol
|
||||
edit="y" # : multi tools for editing (templates/xmlfiles/configfiles/scripts) files
|
||||
exec="n" # : comman shells pages for executing (php/shells) commands
|
||||
fax="y" # : fusionpbx send/recieve faxes service
|
||||
fifo="n" # : first in first out call queues system
|
||||
services="n" # : allows interaction with the processes running on your server
|
||||
traffic_graph="n" # : php graph for monitoing the network interface traffic
|
||||
|
||||
###########################
|
||||
#Optional APP PKGS installs
|
||||
###########################
|
||||
if [[ $adminer == "y" ]]; then
|
||||
apt-get -y --force-yes install fusionpbx-app-adminer
|
||||
fi
|
||||
|
||||
if [[ $backup == "y" ]]; then
|
||||
apt-get -y --force-yes install fusionpbx-app-backup
|
||||
fi
|
||||
|
||||
if [[ $call_broadcast == "y" ]]; then
|
||||
apt-get -y --force-yes install fusionpbx-app-call-broadcast
|
||||
fi
|
||||
|
||||
if [[ $call_center == "y" ]]; then
|
||||
apt-get -y --force-yes install fusionpbx-app-call-center fusionpbx-app-call-center-active
|
||||
if [[ -f /root/.fs_src ]] ; then
|
||||
if [[ ! -f /usr/lib/freeswitch/mod/mod_callcenter ]] ; then
|
||||
echo " Requires freeswitch mod_callcenter "
|
||||
fi
|
||||
else
|
||||
apt-get -y --force-yes install freeswitch-mod-callcenters
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $call_flows == "y" ]]; then
|
||||
apt-get -y --force-yes install fusionpbx-app-call-flows
|
||||
fi
|
||||
|
||||
if [[ $conference_centers == "y" ]]; then
|
||||
apt-get -y --force-yes install freeswitch-mod-conference fusionpbx-app-conference-centers fusionpbx-app-conferences-active fusionpbx-app-meetings
|
||||
if [[ -f /root/.fs_src ]] ; then
|
||||
if [[ ! -f /usr/lib/freeswitch/mod/mod_conference ]] ; then
|
||||
echo " Requires freeswitch mod_conference "
|
||||
fi
|
||||
else
|
||||
apt-get -y --force-yes install freeswitch-mod-conferences
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $conference == "y" ]]; then
|
||||
apt-get -y --force-yes install freeswitch-mod-conference fusionpbx-app-conferences fusionpbx-app-conferences-active fusionpbx-app-meetings
|
||||
if [[ -f /root/.fs_src ]] ; then
|
||||
if [[ ! -f /usr/lib/freeswitch/mod/mod_conference ]] ; then
|
||||
echo " Requires freeswitch mod_conference "
|
||||
fi
|
||||
else
|
||||
apt-get -y --force-yes install freeswitch-mod-conferences
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $edit == "y" ]]; then
|
||||
apt-get -y --force-yes install fusionpbx-app-edit
|
||||
fi
|
||||
|
||||
if [[ $exec == "y" ]]; then
|
||||
apt-get -y --force-yes install fusionpbx-app-exec
|
||||
fi
|
||||
|
||||
if [[ $fax == "y" ]]; then
|
||||
apt-get -y --force-yes install ghostscript libreoffice-common fusionpbx-app-fax
|
||||
fi
|
||||
|
||||
if [[ $fifo == "y" ]]; then
|
||||
apt-get -y --force-yes install freeswitch-mod-fifo fusionpbx-app-fifo fusionpbx-app-fifo-list
|
||||
if [[ -f /root/.fs_src ]] ; then
|
||||
if [[ ! -f /usr/lib/freeswitch/mod/mod_fifo ]] ; then
|
||||
echo " Requires freeswitch mod_fifo "
|
||||
fi
|
||||
else
|
||||
apt-get -y --force-yes install freeswitch-mod-fifo
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $services == "y" ]]; then
|
||||
apt-get -y --force-yes install fusionpbx-app-services
|
||||
fi
|
||||
|
||||
if [[ $traffic_graph == "y" ]]; then
|
||||
apt-get -y --force-yes install fusionpbx-app-traffic-graph
|
||||
fi
|
||||
|
|
@ -4,9 +4,102 @@
|
|||
echo "Install FusionPBX"
|
||||
|
||||
#install dependencies
|
||||
apt-get install -y --force-yes vim git dbus haveged ssl-cert
|
||||
apt-get install -y --force-yes ghostscript libtiff5-dev libtiff-tools
|
||||
apt-get install -y --force-yes vim git dbus haveged
|
||||
apt-get install -y --force-yes ghostscript libtiff5 libtiff-tools
|
||||
|
||||
#get the source code
|
||||
git clone https://github.com/fusionpbx/fusionpbx.git /var/www/fusionpbx
|
||||
chown -R www-data:www-data /var/www/fusionpbx
|
||||
######################
|
||||
#adding FusionPBX repo
|
||||
#######################
|
||||
echo ' installing fusionpbx jessie Stabe/Release repo '
|
||||
cat > "/etc/apt/sources.list.d/fusionpbx.list" <<DELIM
|
||||
deb http://103.247.152.122/fusionpbx/debian/ jessie main
|
||||
DELIM
|
||||
echo
|
||||
|
||||
#################################################
|
||||
#run repo update after adding in a new repo....
|
||||
#################################################
|
||||
apt-get update
|
||||
|
||||
###########################
|
||||
#Installing fusionpbx pkgs
|
||||
###########################
|
||||
apt-get -y --force-yes install fusionpbx-core fusionpbx-app-access-controls fusionpbx-app-calls \
|
||||
fusionpbx-app-calls-active fusionpbx-app-call-block fusionpbx-app-contacts fusionpbx-app-destinations \
|
||||
fusionpbx-app-dialplan fusionpbx-app-dialplan-inbound fusionpbx-app-dialplan-outbound fusionpbx-app-emails \
|
||||
fusionpbx-app-extensions fusionpbx-app-follow-me fusionpbx-app-gateways fusionpbx-app-ivr-menus \
|
||||
fusionpbx-app-log-viewer fusionpbx-app-modules fusionpbx-app-music-on-hold fusionpbx-app-operator-panel \
|
||||
fusionpbx-app-phrases fusionpbx-app-recordings fusionpbx-app-registrations fusionpbx-app-ring-groups \
|
||||
fusionpbx-app-scripts fusionpbx-app-settings fusionpbx-app-sip-profiles fusionpbx-app-sip-status \
|
||||
fusionpbx-app-system fusionpbx-app-time-conditions fusionpbx-app-xml-cdr fusionpbx-app-vars fusionpbx-app-voicemails \
|
||||
fusionpbx-app-voicemail-greetings fusionpbx-conf fusionpbx-sqldb fusionpbx-scripts fusionpbx-theme-default
|
||||
|
||||
#####################################
|
||||
#cp the default configs into place.
|
||||
#####################################
|
||||
cp -rp "$fs_dflt_conf_dir"/vanilla/* "/etc/fusionpbx"
|
||||
|
||||
########################################
|
||||
#fix ownership of files for freeswitch
|
||||
########################################
|
||||
chown -R freeswitch:www-data "/etc/fusionpbx"
|
||||
|
||||
##################################################
|
||||
#configuring freeswitch to start with new layout.
|
||||
##################################################
|
||||
#Freeswitch layout for FHS with fusionpbx
|
||||
##################################################
|
||||
cat > '/etc/default/freeswitch' << DELIM
|
||||
CONFDIR="/etc/fusionpbx"
|
||||
#
|
||||
# Uncooment extra lines and make sure to add cut and paste them to the DAEMON_ARGS
|
||||
# Options to control locations of files:
|
||||
fs_conf="/etc/fusionpbx"
|
||||
fs_db="/var/lib/freeswitch/db"
|
||||
fs_imgs="/var/lib/fusionpbx/images"
|
||||
fs_log="/var/log/freeswitch"
|
||||
fs_recordings="/var/lib/fusionpbx/recordings"
|
||||
fs_run="/var/run/freeswitch"
|
||||
fs_scripts="/var/lib/fusionpbx/scripts"
|
||||
fs_storage="/var/lib/fusionpbx/storage"
|
||||
fs_usr=freeswitch
|
||||
fs_grp=\$fs_usr
|
||||
#
|
||||
#These are the optional arguments you can pass to freeswitch: (add options to fs_options line)
|
||||
# -nf -- no forking
|
||||
# -reincarnate -- restart the switch on an uncontrolled exit
|
||||
# -reincarnate-reexec -- run execv on a restart (helpful for upgrades)
|
||||
# -u [user] -- specify user to switch to
|
||||
# -g [group] -- specify group to switch to
|
||||
# -core -- dump cores
|
||||
# -rp -- enable high(realtime) priority settings
|
||||
# -lp -- enable low priority settings
|
||||
# -np -- enable normal priority settings
|
||||
# -vg -- run under valgrind
|
||||
# -nosql -- disable internal sql scoreboard
|
||||
# -heavy-timer -- Heavy Timer, possibly more accurate but at a cost
|
||||
# -nonat -- disable auto nat detection
|
||||
# -nonatmap -- disable auto nat port mapping
|
||||
# -nocal -- disable clock calibration
|
||||
# -nort -- disable clock clock_realtime
|
||||
# -stop -- stop freeswitch
|
||||
# -nc -- do not output to a console and background
|
||||
# -ncwait -- do not output to a console and background but wait until the system is ready before exiting (implies -nc)
|
||||
# -c -- output to a console and stay in the foreground
|
||||
fs_options="-nc -rp -reincarnate"
|
||||
#
|
||||
# Reads in the arguments into 1 line command
|
||||
DAEMON_ARGS="-u \$fs_usr -g \$fs_grp -conf \$fs_conf -db \$fs_db -images \$fs_images -log \$fs_log -scripts \$fs_scripts -run \$fs_run -storage \$fs_storage -recordings \$fs_recordings \$fs_options"
|
||||
DELIM
|
||||
|
||||
#################################################################
|
||||
#restartng services with thefusionpbx freeswitch fhs dir layoout
|
||||
#################################################################
|
||||
echo " Restarting freeswitch for changes to take effect...."
|
||||
service freeswitch restart
|
||||
|
||||
########################
|
||||
#set permissions on dir
|
||||
########################
|
||||
find "/var/lib/fusionpbx" -type d -exec chmod 775 {} +
|
||||
find "/var/lib/fusionpbx" -type f -exec chmod 664 {} +
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
#########################################################
|
||||
#Turning off Repeated Msg Reduction in /etc/rsyslog.conf"
|
||||
#########################################################
|
||||
sed -i 's/RepeatedMsgReduction\ on/RepeatedMsgReduction\ off/' /etc/rsyslog.conf
|
||||
|
||||
############################
|
||||
# Restarting rsyslog service
|
||||
############################
|
||||
service rsyslog restart
|
||||
|
||||
sed -i /usr/bin/fail2ban-client -e s,^\.setInputCmd\(c\),'time.sleep\(0\.1\)\n\t\t\tbeautifier.setInputCmd\(c\)',
|
||||
|
||||
##############################
|
||||
#Restarting Nginx and PHP FPM
|
||||
##############################
|
||||
for i in freeswitch fail2ban
|
||||
do service "${i}" restart > /dev/null 2>&1
|
||||
done
|
||||
|
||||
############################################################
|
||||
# see http://wiki.fusionpbx.com/index.php?title=RotateFSLogs
|
||||
############################################################
|
||||
cat > "/etc/cron.daily/freeswitch_log_rotation" <<DELIM
|
||||
#!/usr/bin/bash
|
||||
|
||||
#number of days of logs to keep
|
||||
NUMBERDAYS="$keep_logs"
|
||||
FSPATH="/var/log/freeswitch"
|
||||
|
||||
freeswitch_cli -x "fsctl send_sighup" |grep '+OK' >/tmp/rotateFSlogs
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
#-cmin 2 could bite us (leave some files uncompressed, eg 11M auto-rotate). Maybe -1440 is better?
|
||||
find "$FSPATH" -name "freeswitch.log.*" -cmin -2 -exec gzip {} \;
|
||||
find "$FSPATH" -name "freeswitch.log.*.gz" "-mtime" "+$NUMBERDAYS" -exec rm {} \;
|
||||
chown freeswitch:freeswitch "$FSPATH"/freeswitch.log
|
||||
chmod 664 "$FSPATH"/freeswitch.log
|
||||
logger FreeSWITCH Logs rotated
|
||||
rm /tmp/<<DELIM
|
||||
else
|
||||
logger FreeSWITCH Log Rotation Script FAILED
|
||||
mail -s '$HOST FS Log Rotate Error' root < /tmp/<<DELIM
|
||||
rm /tmp/<<DELIM
|
||||
fi
|
||||
|
||||
DELIM
|
||||
|
||||
chmod 664 /etc/cron.daily/freeswitch_log_rotation
|
||||
|
||||
###########################################################
|
||||
# restarting services after fail2ban/monit services install
|
||||
###########################################################
|
||||
for i in php5-fpm niginx monit fail2ban freeswitch ;do service "${i}" restart >/dev/null 2>&1 ; done
|
||||
|
|
@ -4,15 +4,29 @@
|
|||
echo "Install the web server\n"
|
||||
|
||||
#install dependencies
|
||||
apt-get install -y --force-yes nginx php5 php5-cli php5-fpm php5-pgsql php5-sqlite php5-odbc php5-curl php5-imap php5-mcrypt
|
||||
apt-get -y install ssl-cert nginx php5-cli php5-common php-apc php5-gd php-db php5-fpm php5-memcache php5-sqlite php5-imap php5-mcrypt php5-curl
|
||||
|
||||
#enable fusionpbx nginx config
|
||||
cp resources/nginx/fusionpbx /etc/nginx/sites-available/fusionpbx
|
||||
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
|
||||
cp -r /etc/ssl/private/ssl-cert-snakeoil.key /etc/ssl/private/nginx.key
|
||||
cp -r /etc/ssl/certs/ssl-cert-snakeoil.pem /etc/ssl/certs/nginx.crt
|
||||
|
||||
#remove the default site
|
||||
rm /etc/nginx/sites-enabled/default
|
||||
rm /etc/nginx/sites-enabled/default
|
||||
|
||||
# Changing file upload size from 2M to upload_size
|
||||
sed -i /etc/php5/fpm/php.ini -e "s#upload_max_filesize = 2M#upload_max_filesize = 25M#"
|
||||
|
||||
# Changing post_max_size limit from 8M to upload_size
|
||||
sed -i /etc/php5/fpm/php.ini -e "s#post_max_size = 8M#post_max_size = 25M#"
|
||||
|
||||
#Adding users to needed groups
|
||||
adduser www-data freeswitch
|
||||
adduser www-data audio
|
||||
adduser www-data dialout
|
||||
|
||||
#restart nginx
|
||||
service nginx restart
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
server{
|
||||
listen 127.0.0.1:80;
|
||||
server_name 127.0.0.1;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/sh
|
||||
|
||||
#send a message
|
||||
echo "Install PostgreSQL Client"
|
||||
|
||||
#Install postgres repo
|
||||
lsb_release -c |grep -i jessie > /dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
cat > "/etc/apt/sources.list.d/pgsql-pgdg.list" << DELIM
|
||||
deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main
|
||||
DELIM
|
||||
else
|
||||
cat > "/etc/apt/sources.list.d/pgsql-pgdg.list" << DELIM
|
||||
deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main
|
||||
DELIM
|
||||
fi
|
||||
|
||||
#Postgres
|
||||
echo "Install PostgreSQL and create the database and users\n"
|
||||
for i in postgresql-client-9.5 php5-pgsql ;do sudo apt-get -y install --force-yes "${i}"; done
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
#!/bin/sh
|
||||
|
||||
#send a message
|
||||
echo "Install PostgreSQL"
|
||||
|
||||
#Install postgres repo
|
||||
lsb_release -c |grep -i jessie > /dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
cat > "/etc/apt/sources.list.d/pgsql-pgdg.list" << DELIM
|
||||
deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main
|
||||
DELIM
|
||||
else
|
||||
cat > "/etc/apt/sources.list.d/pgsql-pgdg.list" << DELIM
|
||||
deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main
|
||||
DELIM
|
||||
fi
|
||||
|
||||
#update
|
||||
apt-get update
|
||||
|
||||
#generate a random password
|
||||
password=$(dd if=/dev/urandom bs=1 count=20 2>/dev/null | base64)
|
||||
|
||||
#Postgres
|
||||
echo "Install PostgreSQL and create the database and users\n"
|
||||
for i in postgresql-server-9.5 php5-pgsql ;do sudo apt-get -y install --force-yes "${i}"; done
|
||||
|
||||
|
||||
#################################################
|
||||
#Edit the freeswitch systemd toadd pgsql service
|
||||
#################################################
|
||||
sed -i /lib/systemd/system/freeswitch.service -e"s#After=syslog.target network.target local-fs.target#After=syslog.target network.target local-fs.target postgresql.service#"
|
||||
|
||||
#########################################
|
||||
#Edit pg_hba.conf to enable sections
|
||||
########################################
|
||||
sed -i /etc/postgresql/9.5/main/pg_hba.conf -e 's#\#local#local#'
|
||||
sed -i /etc/postgresql/9.5/main/pg_hba.conf -e 's#\#host#host#'
|
||||
|
||||
#systemd
|
||||
service postgresql restart
|
||||
|
||||
#init.d
|
||||
#/usr/sbin/service postgresql restart
|
||||
|
||||
#add the databases, users and grant permissions to them
|
||||
sudo -u postgres psql -c "CREATE DATABASE fusionpbx";
|
||||
sudo -u postgres psql -c "CREATE DATABASE freeswitch";
|
||||
sudo -u postgres psql -c "CREATE ROLE fusionpbx WITH SUPERUSER LOGIN PASSWORD '$password';"
|
||||
sudo -u postgres psql -c "CREATE ROLE freeswitch WITH SUPERUSER LOGIN PASSWORD '$password';"
|
||||
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE fusionpbx to fusionpbx;"
|
||||
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE freeswitch to fusionpbx;"
|
||||
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE freeswitch to freeswitch;"
|
||||
#ALTER USER fusionpbx WITH PASSWORD 'newpassword';
|
||||
|
||||
#set the ip address
|
||||
server_address=$(hostname -I)
|
||||
|
||||
#Show database password
|
||||
echo ""
|
||||
echo ""
|
||||
echo "PostgreSQL"
|
||||
echo " Database name: fusionpbx"
|
||||
echo " Database username: fusionpbx"
|
||||
echo " Database password: $password"
|
||||
echo ""
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
#Selet What Phone Provision System to Install
|
||||
|
||||
aastra="n" # : phone provisioning tool & templates for aastra phones
|
||||
atcom="n" # : phone provisioning tool & templates for atcom phones
|
||||
cisco="n" # : phone provisioning tool & templates for cisco phones
|
||||
digium="n" # : phone provisioning tool & templates for digium phones
|
||||
escene="n" # : phone provisioning tool & templates for escene phones
|
||||
grandstream="n" # : phone provisioning tool & templates for grandstream phones
|
||||
linksys="n" # : phone provisioning tool & templates for linksys phones
|
||||
panasonic="n" # : phone provisioning tool & templates for panasonic phones
|
||||
polycom="n" # : phone provisioning tool & templates for polycom phones
|
||||
snom="n" # : provisioning tool & templates for snom phones
|
||||
yealink="n" # : phone provisioning tool & templates for yealink phones
|
||||
|
||||
|
||||
if [[ $aastra == "y" ]]; then
|
||||
apt-get -y --force-yes install fusionpbx-app-devices fusionpbx-app-provision fusionpbx-provisioning-template-aastra && mkdir -p /etc/fusionpbx/resources/templates/provision && cp -rp /usr/share/examples/fusionpbx/resources/templates/provision/aastra /etc/fusionpbx/resources/templates/provision/
|
||||
fi
|
||||
|
||||
if [[ $atcom == "y" ]]; then
|
||||
apt-get -y --force-yes install fusionpbx-app-devices fusionpbx-app-provision fusionpbx-provisioning-template-atcom && mkdir -p /etc/fusionpbx/resources/templates/provision && cp -rp /usr/share/examples/fusionpbx/resources/templates/provision/atcom /etc/fusionpbx/resources/templates/provision/
|
||||
fi
|
||||
|
||||
if [[ $cisco == "y" ]]; then
|
||||
apt-get -y --force-yes install fusionpbx-app-devices fusionpbx-app-provision fusionpbx-provisioning-template-cisco && mkdir -p /etc/fusionpbx/resources/templates/provision && cp -rp /usr/share/examples/fusionpbx/resources/templates/provision/cisco /etc/fusionpbx/resources/templates/provision/
|
||||
fi
|
||||
|
||||
if [[ $digium == "y" ]]; then
|
||||
apt-get -y --force-yes install fusionpbx-app-devices fusionpbx-app-provision fusionpbx-provisioning-template-digium && mkdir -p /etc/fusionpbx/resources/templates/provision && cp -rp /usr/share/examples/fusionpbx/resources/templates/provision/grandstream /etc/fusionpbx/resources/templates/provision/
|
||||
fi
|
||||
|
||||
if [[ $escene == "y" ]]; then
|
||||
apt-get -y --force-yes install fusionpbx-app-devices fusionpbx-app-provision fusionpbx-provisioning-template-escene && mkdir -p /etc/fusionpbx/resources/templates/provision && cp -rp /usr/share/examples/fusionpbx/resources/templates/provision/grandstream /etc/fusionpbx/resources/templates/provision/
|
||||
fi
|
||||
|
||||
if [[ $grandstream == "y" ]]; then
|
||||
apt-get -y --force-yes install fusionpbx-app-devices fusionpbx-app-provision fusionpbx-provisioning-template-grandstream && mkdir -p /etc/fusionpbx/resources/templates/provision && cp -rp /usr/share/examples/fusionpbx/resources/templates/provision/grandstream /etc/fusionpbx/resources/templates/provision/
|
||||
fi
|
||||
|
||||
if [[ $linksys == "y" ]]; then
|
||||
apt-get -y --force-yes install fusionpbx-app-devices fusionpbx-app-provision fusionpbx-provisioning-template-linksys && mkdir -p /etc/fusionpbx/resources/templates/provision && cp -rp /usr/share/examples/fusionpbx/resources/templates/provision/linksys /etc/fusionpbx/resources/templates/provision/
|
||||
fi
|
||||
|
||||
if [[ $panasonic == "y" ]]; then
|
||||
apt-get -y --force-yes install fusionpbx-app-devices fusionpbx-app-provision fusionpbx-provisioning-template-panasonic && mkdir -p /etc/fusionpbx/resources/templates/provision && cp -rp /usr/share/examples/fusionpbx/resources/templates/provision/panasonic /etc/fusionpbx/resources/templates/provision/
|
||||
fi
|
||||
|
||||
if [[ $polycom == "y" ]]; then
|
||||
apt-get -y --force-yes install fusionpbx-app-devices fusionpbx-app-provision fusionpbx-provisioning-template-polycom && mkdir -p /etc/fusionpbx/resources/templates/provision && cp -rp /usr/share/examples/fusionpbx/resources/templates/provision/polycom /etc/fusionpbx/resources/templates/provision/
|
||||
fi
|
||||
|
||||
if [[ $snom == "y" ]]; then
|
||||
apt-get -y --force-yes install fusionpbx-app-devices fusionpbx-app-provision fusionpbx-provisioning-template-snom && mkdir -p /etc/fusionpbx/resources/templates/provision && cp -rp /usr/share/examples/fusionpbx/resources/templates/provision/snom /etc/fusionpbx/resources/templates/provision/
|
||||
fi
|
||||
|
||||
if [[ $yealink == "y" ]]; then
|
||||
apt-get -y --force-yes install fusionpbx-app-devices fusionpbx-app-provision fusionpbx-provisioning-template-yealink && mkdir -p /etc/fusionpbx/resources/templates/provision && cp -rp /usr/share/examples/fusionpbx/resources/templates/provision/yealink /etc/fusionpbx/resources/templates/provision/
|
||||
fi
|
||||
|
|
@ -1,53 +1,96 @@
|
|||
#!/bin/sh
|
||||
apt-get update && apt-get install -y --force-yes curl memcached haveged
|
||||
(
|
||||
#Repos
|
||||
USE_UNOFFICIAL_ARM_REPO=0
|
||||
arch=$(uname -m)
|
||||
if [ $arch = 'armv7l' ] && [ $USE_UNOFFICIAL_ARM_REPO -eq 1 ]; then
|
||||
echo "deb http://repo.sip247.com/debian/freeswitch-stable-armhf/ jessie main" > /etc/apt/sources.list.d/freeswitch.list
|
||||
curl http://repo.sip247.com/debian/sip247.com.gpg.key | apt-key add -
|
||||
cat > /etc/apt/source.list.d/freeswitch.list << DELIM
|
||||
deb http://repo.sip247.com/debian/freeswitch-stable-armhf/ jessie main
|
||||
DELIM
|
||||
curl http://repo.sip247.com/debian/sip247.com.gpg.key | apt-key add -
|
||||
else
|
||||
echo "deb http://files.freeswitch.org/repo/deb/freeswitch-1.6/ jessie main" > /etc/apt/sources.list.d/freeswitch.list
|
||||
curl http://files.freeswitch.org/repo/deb/freeswitch-1.6/key.gpg | apt-key add -
|
||||
cat > /etc/apt/source.list.d/freeswitch.list << DELIM
|
||||
deb http://files.freeswitch.org/repo/deb/freeswitch-1.6/ jessie main
|
||||
DELIM
|
||||
curl http://files.freeswitch.org/repo/deb/freeswitch-1.6/key.gpg | apt-key add -
|
||||
fi
|
||||
apt-get update
|
||||
apt-get install -y --force-yes gdb
|
||||
apt-get install -y --force-yes freeswitch-meta-bare freeswitch-conf-vanilla freeswitch-systemd freeswitch-mod-commands freeswitch-meta-codecs freeswitch-mod-console freeswitch-mod-logfile freeswitch-mod-distributor
|
||||
apt-get install -y --force-yes freeswitch-lang-en freeswitch-mod-say-en freeswitch-sounds-en-us-callie freeswitch-music-default
|
||||
apt-get install -y --force-yes freeswitch-mod-enum freeswitch-mod-cdr-csv freeswitch-mod-event-socket freeswitch-mod-sofia freeswitch-mod-sofia-dbg freeswitch-mod-loopback
|
||||
apt-get install -y --force-yes freeswitch-mod-conference freeswitch-mod-db freeswitch-mod-dptools freeswitch-mod-expr freeswitch-mod-fifo libyuv-dev freeswitch-mod-httapi
|
||||
apt-get install -y --force-yes freeswitch-mod-hash freeswitch-mod-esl freeswitch-mod-esf freeswitch-mod-fsv freeswitch-mod-valet-parking freeswitch-mod-dialplan-xml freeswitch-dbg
|
||||
apt-get install -y --force-yes freeswitch-mod-sndfile freeswitch-mod-native-file freeswitch-mod-local-stream freeswitch-mod-tone-stream freeswitch-mod-lua freeswitch-meta-mod-say
|
||||
apt-get install -y --force-yes freeswitch-mod-xml-cdr freeswitch-mod-verto freeswitch-mod-callcenter freeswitch-mod-rtc freeswitch-mod-png freeswitch-mod-json-cdr freeswitch-mod-shout
|
||||
apt-get install -y --force-yes freeswitch-mod-skypopen freeswitch-mod-skypopen-dbg freeswitch-mod-sms freeswitch-mod-sms-dbg freeswitch-mod-cidlookup freeswitch-mod-memcache
|
||||
apt-get install -y --force-yes freeswitch-mod-imagick freeswitch-mod-tts-commandline freeswitch-mod-directory freeswitch-mod-flite
|
||||
|
||||
#make sure that postgresql is started before starting freeswitch
|
||||
sed -i /lib/systemd/system/freeswitch.service -e s:'local-fs.target:local-fs.target postgresql.service:'
|
||||
#Used for pkg based installs for cp the base configs into place
|
||||
fs_conf_dir="/etc/freeswitch"
|
||||
fs_dflt_conf_dir="/usr/share/freeswitch/conf"
|
||||
|
||||
#set the file permissions
|
||||
mkdir /usr/share/freeswitch/scripts
|
||||
chmod g+ws /usr/share/freeswitch/scripts
|
||||
# Set what language lang/say pkgs and language sound files to use. ( Only if pkgs install is selected )
|
||||
# en-ca=English/CA en-us=English/US (default) fr-ca=French/Canadian pt-br=Portuguese/Brazill
|
||||
# ru-ru=Russian/Russia sv-se=Swedish/Sweden zh-cn=chinese/Mandarin zh-hk=chinese/HongKong
|
||||
freeswitch_sounds_language="en-us" #Currently other sounds dont exist.
|
||||
|
||||
chown -R freeswitch:freeswitch /var/lib/freeswitch
|
||||
chmod -R g+s /var/lib/freeswitch
|
||||
setfacl -R -m u:www-data:rwx,g:www-data:rwx /var/lib/freeswitch
|
||||
setfacl -R -d -m u:www-data:rwx,g:www-data:rwx /var/lib/freeswitch
|
||||
#Pre Deps
|
||||
apt-get update && apt-get -y install --force-yes sqlite3 unixodbc uuid memcached libtiff5 libtiff-tools time bison htop screen libpq5 lame curl haveged
|
||||
|
||||
chown -R freeswitch:freeswitch /usr/share/freeswitch
|
||||
chmod -R g+s /usr/share/freeswitch
|
||||
setfacl -R -m u:www-data:rwx,g:www-data:rwx /usr/share/freeswitch
|
||||
setfacl -R -d -m u:www-data:rwx,g:www-data:rwx /usr/share/freeswitch
|
||||
#Freeswitch Pkgs
|
||||
apt-get -y install --force-yes libfreeswitch1 freeswitch freeswitch-mod-curl freeswitch-systemd freeswitch-mod-db freeswitch-doc \
|
||||
freeswitch-mod-distributor freeswitch-mod-dptools freeswitch-mod-enum freeswitch-mod-esf freeswitch-mod-esl \
|
||||
freeswitch-mod-expr freeswitch-mod-fsv freeswitch-mod-hash freeswitch-mod-memcache freeswitch-mod-portaudio \
|
||||
freeswitch-mod-portaudio-stream freeswitch-mod-spandsp freeswitch-mod-spy freeswitch-mod-translate \
|
||||
freeswitch-mod-valet-parking freeswitch-mod-flite freeswitch-mod-pocketsphinx freeswitch-mod-tts-commandline \
|
||||
freeswitch-mod-dialplan-xml freeswitch-mod-loopback freeswitch-mod-sofia freeswitch-mod-event-multicast \
|
||||
freeswitch-mod-event-socket freeswitch-mod-local-stream freeswitch-mod-native-file freeswitch-mod-sndfile \
|
||||
freeswitch-mod-tone-stream freeswitch-mod-lua freeswitch-mod-console freeswitch-mod-logfile freeswitch-mod-syslog \
|
||||
freeswitch-mod-say-en freeswitch-mod-posix-timer freeswitch-mod-timerfd freeswitch-mod-xml-cdr freeswitch-mod-shout\
|
||||
freeswitch-mod-xml-curl freeswitch-mod-xml-rpc freeswitch-conf-vanilla freeswitch-mod-vlc freeswitch-mod-verto \
|
||||
freeswitch-mod-sms freeswitch-timezones freeswitch-mod-bert freeswitch-mod-basic freeswitch-mod-lcr freeswitch-mod-rtc \
|
||||
freeswitch-mod-commands freeswitch-mod-cdr-csv
|
||||
|
||||
#setup language / sound files for use
|
||||
#if [[ $freeswitch_sounds_language == "en-ca" ]]; then
|
||||
# apt-get -y install --force-yes freeswitch-lang-en freeswitch-mod-say-en freeswitch-sounds-en-ca-june
|
||||
#fi
|
||||
|
||||
chown -R freeswitch:freeswitch /etc/freeswitch
|
||||
chmod -R g+s /etc/freeswitch
|
||||
setfacl -R -m u:www-data:rwx,g:www-data:rwx /etc/freeswitch
|
||||
setfacl -R -d -m u:www-data:rwx,g:www-data:rwx /etc/freeswitch
|
||||
if [[ $freeswitch_sounds_language == "en-us" ]]; then
|
||||
apt-get -y install --force-yes freeswitch-lang-en freeswitch-mod-say-en freeswitch-sounds-en-us-callie freeswitch-music-default
|
||||
fi
|
||||
|
||||
chown -R freeswitch:freeswitch /var/log/freeswitch
|
||||
setfacl -R -m u:www-data:rwx,g:www-data:rwx /var/log/freeswitch
|
||||
setfacl -R -d -m u:www-data:rwx,g:www-data:rwx /var/log/freeswitch
|
||||
#if [[ $freeswitch_sounds_language == "fr-ca" ]]; then
|
||||
# apt-get -y install --force-yes freeswitch-lang-fr freeswitch-mod-say-fr freeswitch-sounds-fr-ca-june
|
||||
#fi
|
||||
#
|
||||
#if [[ $freeswitch_sounds_language == "pt-br" ]]; then
|
||||
# apt-get -y install --force-yes freeswitch-lang-pt freeswitch-mod-say-pt freeswitch-sounds-pt-br-karina
|
||||
#fi
|
||||
#
|
||||
#if [[ $freeswitch_sounds_language == "ru-ru" ]]; then
|
||||
# apt-get -y install --force-yes freeswitch-lang-ru freeswitch-mod-say-ru freeswitch-sounds-ru-ru-elena
|
||||
#fi
|
||||
#
|
||||
#if [[ $freeswitch_sounds_language == "sv-se" ]]; then
|
||||
# apt-get -y install --force-yes freeswitch-lang-sv freeswitch-mod-say-sv freeswitch-sounds-sv-se-jakob
|
||||
#fi
|
||||
|
||||
chown -R freeswitch:freeswitch /usr/share/freeswitch/sounds
|
||||
chmod -R g+s /usr/share/freeswitch/sounds
|
||||
setfacl -R -m u:www-data:rwx,g:www-data:rwx /usr/share/freeswitch/sounds
|
||||
setfacl -R -d -m u:www-data:rwx,g:www-data:rwx /usr/share/freeswitch/sounds
|
||||
#if [[ $freeswitch_sounds_language == "zh-cn" ]]; then
|
||||
# apt-get -y install --force-yes freeswitch-mod-say-zh freeswitch-sounds-zh-cn-sinmei
|
||||
#fi
|
||||
|
||||
#if [[ $freeswitch_sounds_language == "zh-hk" ]]; then
|
||||
# apt-get -y install --force-yes freeswitch-mod-say-zh freeswitch-sounds-zh-hk-sinmei
|
||||
#fi
|
||||
|
||||
# make the freeswitch conf dir
|
||||
mkdir -p "$fs_conf_dir"
|
||||
|
||||
#cp the default configs into place.
|
||||
cp -rp "$fs_dflt_conf_dir"/vanilla/* "$fs_conf_dir"
|
||||
|
||||
#fix ownership of files for freeswitch
|
||||
chown -R freeswitch:freeswitch "$fs_conf_dir"
|
||||
|
||||
#Adding users to needed groups
|
||||
adduser freeswitch www-data
|
||||
adduser freeswitch dialout
|
||||
|
||||
#Restarting freeswitch
|
||||
service freeswitch restart
|
||||
|
||||
#cleanup
|
||||
apt-get clean
|
||||
|
||||
) | tee ~/freeswitch-install.log
|
||||
|
|
@ -26,7 +26,7 @@ sed -i /usr/src/freeswitch/modules.conf -e s:'#applications/mod_curl:application
|
|||
sed -i /usr/src/freeswitch/modules.conf -e s:'#formats/mod_shout:formats/mod_shout:'
|
||||
#./configure --help
|
||||
#./configure --prefix=/usr/local/freeswitch --enable-core-pgsql-support --enable-system-lua --disable-fhs
|
||||
./configure --prefix=/usr/local/freeswitch --enable-core-pgsql-support --disable-fhs
|
||||
./configure --prefix=/usr/local/freeswitch --enable-core-pgsql-support
|
||||
#make mod_shout-install
|
||||
make
|
||||
rm -rf /usr/local/freeswitch/{lib,mod,bin}/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue