2016-04-29 21:24:22 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
2016-06-14 02:40:49 +02:00
|
|
|
#move to script directory so all relative paths work
|
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
|
|
2017-03-04 22:00:30 +01:00
|
|
|
#includes
|
|
|
|
|
. ./resources/config.sh
|
2016-10-01 00:59:58 +02:00
|
|
|
. ./resources/colors.sh
|
2017-03-04 23:10:20 +01:00
|
|
|
. ./resources/environment.sh
|
2016-05-26 12:55:14 +02:00
|
|
|
|
2016-06-08 15:04:57 +02:00
|
|
|
# removes the cd img from the /etc/apt/sources.list file (not needed after base install)
|
|
|
|
|
sed -i '/cdrom:/d' /etc/apt/sources.list
|
|
|
|
|
|
2017-03-04 22:00:30 +01:00
|
|
|
#Update to latest packages
|
|
|
|
|
verbose "Update installed packages"
|
2017-08-03 17:34:11 +02:00
|
|
|
apt-get update && apt-get upgrade -y --force-yes
|
2016-04-29 21:24:22 +02:00
|
|
|
|
2017-02-25 02:15:15 +01:00
|
|
|
#Add dependencies
|
|
|
|
|
apt-get install -y lsb-release
|
|
|
|
|
|
2016-04-29 21:24:22 +02:00
|
|
|
#IPTables
|
2016-05-26 12:55:14 +02:00
|
|
|
resources/iptables.sh
|
2016-04-29 21:24:22 +02:00
|
|
|
|
2017-05-11 06:03:58 +02:00
|
|
|
#sngrep
|
|
|
|
|
resources/sngrep.sh
|
|
|
|
|
|
2017-01-12 05:12:21 +01:00
|
|
|
#FusionPBX
|
|
|
|
|
resources/fusionpbx.sh
|
|
|
|
|
|
2016-04-29 21:24:22 +02:00
|
|
|
#NGINX web server
|
2016-05-26 12:55:14 +02:00
|
|
|
resources/nginx.sh
|
2016-04-29 21:24:22 +02:00
|
|
|
|
2016-08-02 19:14:57 +02:00
|
|
|
#PHP
|
|
|
|
|
resources/php.sh
|
|
|
|
|
|
2016-04-29 21:24:22 +02:00
|
|
|
#Fail2ban
|
2016-05-26 12:55:14 +02:00
|
|
|
resources/fail2ban.sh
|
2016-04-29 21:24:22 +02:00
|
|
|
|
|
|
|
|
#FreeSWITCH
|
2017-03-04 22:00:30 +01:00
|
|
|
resources/switch.sh
|
2016-04-29 21:24:22 +02:00
|
|
|
|
|
|
|
|
#Postgres
|
2016-05-26 12:55:14 +02:00
|
|
|
resources/postgres.sh
|
2016-04-29 21:24:22 +02:00
|
|
|
|
|
|
|
|
#set the ip address
|
|
|
|
|
server_address=$(hostname -I)
|
|
|
|
|
|
|
|
|
|
#restart services
|
2016-06-11 16:50:10 +02:00
|
|
|
systemctl daemon-reload
|
2017-03-04 21:54:52 +01:00
|
|
|
if [ ."$php_version" = ."5" ]; then
|
2017-02-28 17:32:26 +01:00
|
|
|
systemctl restart php5-fpm
|
2017-03-04 21:54:52 +01:00
|
|
|
fi
|
|
|
|
|
if [ ."$php_version" = ."7" ]; then
|
2017-02-28 17:32:26 +01:00
|
|
|
systemctl restart php7.0-fpm
|
|
|
|
|
fi
|
2016-06-11 16:50:10 +02:00
|
|
|
systemctl restart nginx
|
|
|
|
|
systemctl restart fail2ban
|
2016-04-29 21:24:22 +02:00
|
|
|
|
2017-01-12 05:12:21 +01:00
|
|
|
#add the database schema, user and groups
|
|
|
|
|
resources/finish.sh
|