From ffab97d81bbbdb560a2ccf09492f6e7b2ddf5585 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Fri, 3 Mar 2017 13:08:54 -0700 Subject: [PATCH 01/60] Update finish.sh --- debian/resources/finish.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/debian/resources/finish.sh b/debian/resources/finish.sh index 50f64dd..9cc2bf7 100755 --- a/debian/resources/finish.sh +++ b/debian/resources/finish.sh @@ -93,10 +93,12 @@ echo " If you need to login to a different domain then use username@domain." echo " username: $user_name@$domain_name"; echo "" echo " Official FusionPBX Training" -echo " Admin Training 24 - 26 Jan (3 Days)" -echo " Advanced Training 31 Jan - Feb 2 (3 Days)" +echo " Fastest and best way to learn FusionPBX." +echo " Admin Training 27 - 28 March (2 Days)" +echo " Advanced Training 29 - 30 March (2 Days)" echo " Timezone: https://www.timeanddate.com/worldclock/usa/boise" -echo " For more info visit https://www.fusionpbx.com" +echo " Available online and in person. Includes documentation and recording." +echo " For more information visit https://www.fusionpbx.com" echo "" echo " Additional information." echo " https://fusionpbx.com/support.php" From 4287a384706b784da6c7111ef5313b0d1111ccfa Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 10:36:42 -0700 Subject: [PATCH 02/60] Create config.sh --- debian/resources/config.sh | 1 + 1 file changed, 1 insertion(+) create mode 100644 debian/resources/config.sh diff --git a/debian/resources/config.sh b/debian/resources/config.sh new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/debian/resources/config.sh @@ -0,0 +1 @@ + From 6e3851a1aeefb82b188e6f94d7d4b4d0a19064f0 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 11:21:28 -0700 Subject: [PATCH 03/60] Update config.sh --- debian/resources/config.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/debian/resources/config.sh b/debian/resources/config.sh index 8b13789..c76b0f1 100644 --- a/debian/resources/config.sh +++ b/debian/resources/config.sh @@ -1 +1,15 @@ +# FusionPBX Settings +system_branch=stable # master, stable + +# FreeSWITCH Settings +switch_source=false # true or false +switch_package=true # true or false +switch_branch=stable # master, stable + +# General Settings +cpu_architecture=x86 # arm, x86_64 +cpu_mode=64 # 32 or 64 bit +php_version=5 # PHP version 5 or 7 +database_version=9.6 # PostgresSQL 9.4 or 9.6 +web_server_name=nginx # nginx From 7d48203c8d95fcb60cc90ea6927e39e735621bca Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 12:34:29 -0700 Subject: [PATCH 04/60] Update config.sh --- debian/resources/config.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/debian/resources/config.sh b/debian/resources/config.sh index c76b0f1..213f1c9 100644 --- a/debian/resources/config.sh +++ b/debian/resources/config.sh @@ -1,15 +1,15 @@ # FusionPBX Settings -system_branch=stable # master, stable +system_branch=stable # master, stable # FreeSWITCH Settings -switch_source=false # true or false -switch_package=true # true or false -switch_branch=stable # master, stable +switch_source=false # true or false +switch_package=true # true or false +switch_branch=stable # master, stable # General Settings -cpu_architecture=x86 # arm, x86_64 -cpu_mode=64 # 32 or 64 bit -php_version=5 # PHP version 5 or 7 -database_version=9.6 # PostgresSQL 9.4 or 9.6 -web_server_name=nginx # nginx +cpu_architecture=x86 # arm, x86_64 +cpu_mode=64 # 32 or 64 bit +php_version=5 # PHP version 5 or 7 +database_version=9.6 # PostgresSQL 9.4 or 9.6 +web_server_name=nginx # nginx From ab928631e70ca77a20321899d4431a2a80822c32 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 12:49:27 -0700 Subject: [PATCH 05/60] Update finish.sh --- debian/resources/finish.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/resources/finish.sh b/debian/resources/finish.sh index 9cc2bf7..c86207e 100755 --- a/debian/resources/finish.sh +++ b/debian/resources/finish.sh @@ -4,6 +4,7 @@ cd "$(dirname "$0")" #includes +. ./config.sh . ./colors.sh . ./arguments.sh From 5ed396113a2a8bdec4c9f451ef6ea25229a61989 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 12:50:13 -0700 Subject: [PATCH 06/60] Update fail2ban.sh --- debian/resources/fail2ban.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/resources/fail2ban.sh b/debian/resources/fail2ban.sh index b6247e0..d811b48 100755 --- a/debian/resources/fail2ban.sh +++ b/debian/resources/fail2ban.sh @@ -3,6 +3,7 @@ #move to script directory so all relative paths work cd "$(dirname "$0")" +. ./config.sh . ./colors.sh . ./arguments.sh From 9869052d3f113a9c91c331879af40e718e82e60e Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 12:51:05 -0700 Subject: [PATCH 07/60] Update fusionpbx.sh --- debian/resources/fusionpbx.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/resources/fusionpbx.sh b/debian/resources/fusionpbx.sh index 51180d1..ec76671 100755 --- a/debian/resources/fusionpbx.sh +++ b/debian/resources/fusionpbx.sh @@ -3,6 +3,7 @@ #move to script directory so all relative paths work cd "$(dirname "$0")" +. ./config.sh . ./colors.sh . ./arguments.sh From 1835dba5afa86b09a73f5f1a6d7927372df7ea71 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 12:52:23 -0700 Subject: [PATCH 08/60] Update iptables.sh --- debian/resources/iptables.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/resources/iptables.sh b/debian/resources/iptables.sh index 188e024..b1a11c5 100755 --- a/debian/resources/iptables.sh +++ b/debian/resources/iptables.sh @@ -3,6 +3,7 @@ #move to script directory so all relative paths work cd "$(dirname "$0")" +. ./config.sh . ./colors.sh . ./arguments.sh From 468da39afbcf7940c9210416a87c0a71f45948c1 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 12:53:41 -0700 Subject: [PATCH 09/60] Update letsencrypt.sh --- debian/resources/letsencrypt.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/resources/letsencrypt.sh b/debian/resources/letsencrypt.sh index 00e2194..3017911 100644 --- a/debian/resources/letsencrypt.sh +++ b/debian/resources/letsencrypt.sh @@ -1,5 +1,11 @@ #!/bin/sh +#move to script directory so all relative paths work +cd "$(dirname "$0")" + +#includes +. ./config.sh + #request the domain and email read -p 'Domain Name: ' domain_name read -p 'Email Address: ' email_address From c8ea43a19c7d4edf0646e5198723097072e46d89 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 12:54:32 -0700 Subject: [PATCH 10/60] Update nginx.sh --- debian/resources/nginx.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/resources/nginx.sh b/debian/resources/nginx.sh index a4797d4..b1bb49c 100755 --- a/debian/resources/nginx.sh +++ b/debian/resources/nginx.sh @@ -3,6 +3,8 @@ #move to script directory so all relative paths work cd "$(dirname "$0")" +#includes +. ./config.sh . ./colors.sh . ./arguments.sh From 7141d478422872d331f6fa5d923379f4c792ab2c Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 12:55:29 -0700 Subject: [PATCH 11/60] Update php.sh --- debian/resources/php.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/resources/php.sh b/debian/resources/php.sh index d9232c5..ed362f4 100755 --- a/debian/resources/php.sh +++ b/debian/resources/php.sh @@ -3,6 +3,8 @@ #move to script directory so all relative paths work cd "$(dirname "$0")" +#includes +. ./config.sh . ./colors.sh . ./arguments.sh From 366663633d2ef03f16c41895267373b635e67a3e Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 12:56:38 -0700 Subject: [PATCH 12/60] Update postgres.sh --- debian/resources/postgres.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/resources/postgres.sh b/debian/resources/postgres.sh index 2dece12..8362b0a 100755 --- a/debian/resources/postgres.sh +++ b/debian/resources/postgres.sh @@ -1,5 +1,11 @@ #!/bin/sh +#move to script directory so all relative paths work +cd "$(dirname "$0")" + +#includes +. ./config.sh + #send a message echo "Install PostgreSQL" From 47aaf6b21209d4e8aa7776deadc20a17989c4438 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 12:58:08 -0700 Subject: [PATCH 13/60] Update fail2ban.sh --- debian/resources/fail2ban.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/resources/fail2ban.sh b/debian/resources/fail2ban.sh index d811b48..a912122 100755 --- a/debian/resources/fail2ban.sh +++ b/debian/resources/fail2ban.sh @@ -3,6 +3,7 @@ #move to script directory so all relative paths work cd "$(dirname "$0")" +#includes . ./config.sh . ./colors.sh . ./arguments.sh From 06ffff2d3245fe27e9cb06beeab809cf70d64819 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 13:08:34 -0700 Subject: [PATCH 14/60] Update config.sh --- debian/resources/config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/resources/config.sh b/debian/resources/config.sh index 213f1c9..ade6348 100644 --- a/debian/resources/config.sh +++ b/debian/resources/config.sh @@ -11,5 +11,5 @@ switch_branch=stable # master, stable cpu_architecture=x86 # arm, x86_64 cpu_mode=64 # 32 or 64 bit php_version=5 # PHP version 5 or 7 -database_version=9.6 # PostgresSQL 9.4 or 9.6 +database_repo=official # PostgresSQL official, system, 2ndquadrant web_server_name=nginx # nginx From c6d87ffd828a1a7b792107982a9be780a5279589 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 13:20:01 -0700 Subject: [PATCH 15/60] Update postgres.sh --- debian/resources/postgres.sh | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/debian/resources/postgres.sh b/debian/resources/postgres.sh index 8362b0a..b07f2f4 100755 --- a/debian/resources/postgres.sh +++ b/debian/resources/postgres.sh @@ -16,21 +16,27 @@ password=$(dd if=/dev/urandom bs=1 count=20 2>/dev/null | base64) echo "Install PostgreSQL and create the database and users\n" #included in the distribution -#apt-get install -y --force-yes sudo postgresql +if [ ."$database_repo" = ."system" ]; then + apt-get install -y --force-yes sudo postgresql +end #postgres official repository -echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' > /etc/apt/sources.list.d/pgdg.list -wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - -apt-get update && apt-get upgrade -y -apt-get install -y --force-yes sudo postgresql +if [ ."$database_repo" = "official" ]; then + echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' > /etc/apt/sources.list.d/pgdg.list + wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - + apt-get update && apt-get upgrade -y + apt-get install -y --force-yes sudo postgresql +fi #Add PostgreSQL and BDR REPO -#echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' >> /etc/apt/sources.list.d/postgresql.list -#echo 'deb http://packages.2ndquadrant.com/bdr/apt/ jessie-2ndquadrant main' >> /etc/apt/sources.list.d/2ndquadrant.list -#/usr/bin/wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | apt-key add - -#/usr/bin/wget --quiet -O - http://packages.2ndquadrant.com/bdr/apt/AA7A6805.asc | apt-key add - -#apt-get update && apt-get upgrade -y -#apt-get install -y --force-yes sudo postgresql-bdr-9.4 postgresql-bdr-9.4-bdr-plugin postgresql-bdr-contrib-9.4 +if [ ."$database_repo" = "2ndquadrant" ]; then + echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' >> /etc/apt/sources.list.d/postgresql.list + echo 'deb http://packages.2ndquadrant.com/bdr/apt/ jessie-2ndquadrant main' >> /etc/apt/sources.list.d/2ndquadrant.list + /usr/bin/wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | apt-key add - + /usr/bin/wget --quiet -O - http://packages.2ndquadrant.com/bdr/apt/AA7A6805.asc | apt-key add - + apt-get update && apt-get upgrade -y + apt-get install -y --force-yes sudo postgresql-bdr-9.4 postgresql-bdr-9.4-bdr-plugin postgresql-bdr-contrib-9.4 +fi #systemd systemctl daemon-reload From 553d9c5f9baf37edec0068f6f183e76daf932fde Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 13:22:57 -0700 Subject: [PATCH 16/60] Update postgres.sh --- debian/resources/postgres.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/resources/postgres.sh b/debian/resources/postgres.sh index b07f2f4..026458d 100755 --- a/debian/resources/postgres.sh +++ b/debian/resources/postgres.sh @@ -18,10 +18,10 @@ echo "Install PostgreSQL and create the database and users\n" #included in the distribution if [ ."$database_repo" = ."system" ]; then apt-get install -y --force-yes sudo postgresql -end +fi #postgres official repository -if [ ."$database_repo" = "official" ]; then +if [ ."$database_repo" = ."official" ]; then echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' > /etc/apt/sources.list.d/pgdg.list wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - apt-get update && apt-get upgrade -y @@ -29,7 +29,7 @@ if [ ."$database_repo" = "official" ]; then fi #Add PostgreSQL and BDR REPO -if [ ."$database_repo" = "2ndquadrant" ]; then +if [ ."$database_repo" = ."2ndquadrant" ]; then echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' >> /etc/apt/sources.list.d/postgresql.list echo 'deb http://packages.2ndquadrant.com/bdr/apt/ jessie-2ndquadrant main' >> /etc/apt/sources.list.d/2ndquadrant.list /usr/bin/wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | apt-key add - From 8b55bddb122c8e25a9197dce21e0f3ada49ca662 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 13:29:53 -0700 Subject: [PATCH 17/60] Update php.sh --- debian/resources/php.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/debian/resources/php.sh b/debian/resources/php.sh index ed362f4..fa369ba 100755 --- a/debian/resources/php.sh +++ b/debian/resources/php.sh @@ -12,10 +12,11 @@ cd "$(dirname "$0")" verbose "Configuring PHP" #update config if source is being used -if [ .$USE_PHP5_PACKAGE = .true ]; then +if [ ."$php_version" = ."5" ]; then verbose "version 5.x" php_ini_file='/etc/php5/fpm/php.ini' -else +fi +if [ ."$php_version" = ."7" ]; then verbose "version 7.0" php_ini_file='/etc/php/7.0/fpm/php.ini' fi @@ -24,11 +25,13 @@ sed 's#upload_max_filesize = .*#upload_max_filesize = 80M#g' -i $php_ini_file #restart php-fpm #systemd -if [ .$USE_PHP5_PACKAGE = .true ]; then +if [ ."$php_version" = ."5" ]; then systemctl restart php5-fpm -else +fi +if [ ."$php_version" = ."7" ]; then systemctl restart php7.0-fpm fi #init.d +#/usr/sbin/service php5-fpm restart #/usr/sbin/service php7.0-fpm restart From dccd270332b9034bcec6f7ddcaee1ea590edb27a Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 13:38:24 -0700 Subject: [PATCH 18/60] Update nginx.sh --- debian/resources/nginx.sh | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/debian/resources/nginx.sh b/debian/resources/nginx.sh index b1bb49c..aba7baf 100755 --- a/debian/resources/nginx.sh +++ b/debian/resources/nginx.sh @@ -14,19 +14,15 @@ verbose "Installing the web server" arch=$(uname -m) real_os=$(lsb_release -is) codename=$(lsb_release -cs) -if [ .$USE_SWITCH_PACKAGE_UNOFFICIAL_ARM = .true ]; then +if [ .$cpu_architecture = "arm" ]; then #9.x - */stretch/ #8.x - */jessie/ - if [ .$codename = .'jessie' ]; then - USE_PHP5_PACKAGE = true - fi fi -if [ .$USE_PHP5_PACKAGE = .true ]; then - #don't add php7.0 repository - verbose "Switching forcefully to php5* packages" - which add-apt-repository || apt-get install -y software-properties-common - LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php - LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php5-compat +if [ ."$php_version" = ."5" ]; then + #verbose "Switching forcefully to php5* packages" + #which add-apt-repository || apt-get install -y software-properties-common + #LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php + #LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php5-compat elif [ .$real_os = .'Ubuntu' ]; then #16.10.x - */yakkety/ #16.04.x - */xenial/ @@ -48,18 +44,20 @@ apt-get update #install dependencies apt-get install -y nginx -if [ .$USE_PHP5_PACKAGE = .true ]; then +if [ ."$php_version" = ."5" ]; then apt-get install -y php5 php5-cli php5-fpm php5-pgsql php5-sqlite php5-odbc php5-curl php5-imap php5-mcrypt -else +fi +if [ ."$php_version" = ."7" ]; then apt-get install -y php7.0 php7.0-cli php7.0-fpm php7.0-pgsql php7.0-sqlite3 php7.0-odbc php7.0-curl php7.0-imap php7.0-mcrypt php7.0-xml fi #enable fusionpbx nginx config cp nginx/fusionpbx /etc/nginx/sites-available/fusionpbx #prepare socket name -if [ .$USE_PHP5_PACKAGE = .true ]; then +if [ ."$php_version" = ."5" ]; then sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php5-fpm.sock;#g' -else +fi +if [ ."$php_version" = ."7" ]; then sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php/php7.0-fpm.sock;#g' fi ln -s /etc/nginx/sites-available/fusionpbx /etc/nginx/sites-enabled/fusionpbx From f6843e1abee89a61a0b6a41342ef15a36f2add77 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 13:44:28 -0700 Subject: [PATCH 19/60] Update fusionpbx.sh --- debian/resources/fusionpbx.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/debian/resources/fusionpbx.sh b/debian/resources/fusionpbx.sh index ec76671..20c2660 100755 --- a/debian/resources/fusionpbx.sh +++ b/debian/resources/fusionpbx.sh @@ -14,18 +14,18 @@ verbose "Installing FusionPBX" apt-get install -y --force-yes vim git dbus haveged ssl-cert apt-get install -y --force-yes ghostscript libtiff5-dev libtiff-tools -if [ .$USE_SYSTEM_MASTER = .true ]; then +if [ .$system_branch = "master" ]; then verbose "Using master" - BRANCH="" + branch="" else - 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) - 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) - FUSION_VERSION=$FUSION_MAJOR.$FUSION_MINOR - verbose "Using version $FUSION_VERSION" - BRANCH="-b $FUSION_VERSION" + system_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) + system_minor=$(git ls-remote --tags https://github.com/fusionpbx/fusionpbx.git $system_major.* | cut -d/ -f3 | grep -P '^\d+\.\d+' | sort | tail -n 1 | cut -d. -f2) + system_version=$system_major.$system_minor + verbose "Using version $system_version" + branch="-b $system_version" fi #get the source code -git clone $BRANCH https://github.com/fusionpbx/fusionpbx.git /var/www/fusionpbx +git clone $branch https://github.com/fusionpbx/fusionpbx.git /var/www/fusionpbx chown -R www-data:www-data /var/www/fusionpbx chmod -R 755 /var/www/fusionpbx/secure From 3ec71dcbd1d62f8236a1fade6364ae7bd9821834 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 13:47:01 -0700 Subject: [PATCH 20/60] Update fail2ban.sh --- debian/resources/fail2ban.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/resources/fail2ban.sh b/debian/resources/fail2ban.sh index a912122..7e7584c 100755 --- a/debian/resources/fail2ban.sh +++ b/debian/resources/fail2ban.sh @@ -25,7 +25,7 @@ cp fail2ban/nginx-dos.conf /etc/fail2ban/filter.d/nginx-dos.conf cp fail2ban/jail.local /etc/fail2ban/jail.local #update config if source is being used -if [ .$USE_FREESWITCH_SOURCE = .true ]; then +if [ .$switch_source = .true ]; then sed 's#var/log/freeswitch#usr/local/freeswitch/log#g' -i /etc/fail2ban/jail.local fi From 351358fec15af05c0b86a78f90e9a05f953176c6 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 13:54:52 -0700 Subject: [PATCH 21/60] Update install.sh --- debian/install.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/install.sh b/debian/install.sh index 4876fd7..9180b45 100755 --- a/debian/install.sh +++ b/debian/install.sh @@ -157,9 +157,10 @@ server_address=$(hostname -I) #restart services systemctl daemon-reload -if [ .$USE_PHP5_PACKAGE = .true ]; then +if [ ."$php_version" = ."5" ]; then systemctl restart php5-fpm -else +fi +if [ ."$php_version" = ."7" ]; then systemctl restart php7.0-fpm fi systemctl restart nginx From 8ed6915066386b0559b7cdfa02f68b6524a46f25 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 14:00:30 -0700 Subject: [PATCH 22/60] Update install.sh --- debian/install.sh | 48 +++++------------------------------------------ 1 file changed, 5 insertions(+), 43 deletions(-) diff --git a/debian/install.sh b/debian/install.sh index 9180b45..e034a49 100755 --- a/debian/install.sh +++ b/debian/install.sh @@ -3,6 +3,8 @@ #move to script directory so all relative paths work cd "$(dirname "$0")" +#includes +. ./resources/config.sh . ./resources/colors.sh . ./resources/arguments.sh @@ -84,8 +86,8 @@ fi # removes the cd img from the /etc/apt/sources.list file (not needed after base install) sed -i '/cdrom:/d' /etc/apt/sources.list -#Update Debian -verbose "Update Debian" +#Update to latest packages +verbose "Update installed packages" apt-get upgrade && apt-get update -y --force-yes #Add dependencies @@ -107,47 +109,7 @@ resources/php.sh resources/fail2ban.sh #FreeSWITCH -if [ .$USE_SWITCH_SOURCE = .true ]; then - if [ .$USE_SWITCH_MASTER = .true ]; then - resources/switch/source-master.sh - else - resources/switch/source-release.sh - fi - - #copy the switch conf files to /etc/freeswitch - resources/switch/conf-copy.sh - - #set the file permissions - resources/switch/source-permissions.sh - - #systemd service - resources/switch/source-systemd.sh - -else - if [ .$USE_SWITCH_MASTER = .true ]; then - if [ .$USE_SWITCH_PACKAGE_ALL = .true ]; then - resources/switch/package-master-all.sh - else - resources/switch/package-master.sh - fi - else - if [ .$USE_SWITCH_PACKAGE_ALL = .true ]; then - resources/switch/package-all.sh - else - resources/switch/package-release.sh - fi - fi - - #copy the switch conf files to /etc/freeswitch - resources/switch/conf-copy.sh - - #set the file permissions - resources/switch/package-permissions.sh - - #systemd service - resources/switch/package-systemd.sh - -fi +resources/switch.sh #Postgres resources/postgres.sh From 5a759bc66657d4538f6b92d874a0340673d58f80 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 14:01:43 -0700 Subject: [PATCH 23/60] Create switch.sh --- debian/resources/switch.sh | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 debian/resources/switch.sh diff --git a/debian/resources/switch.sh b/debian/resources/switch.sh new file mode 100644 index 0000000..55b8e66 --- /dev/null +++ b/debian/resources/switch.sh @@ -0,0 +1,43 @@ + + +if [ .$USE_SWITCH_SOURCE = .true ]; then + if [ .$USE_SWITCH_MASTER = .true ]; then + resources/switch/source-master.sh + else + resources/switch/source-release.sh + fi + + #copy the switch conf files to /etc/freeswitch + resources/switch/conf-copy.sh + + #set the file permissions + resources/switch/source-permissions.sh + + #systemd service + resources/switch/source-systemd.sh + +else + if [ .$USE_SWITCH_MASTER = .true ]; then + if [ .$USE_SWITCH_PACKAGE_ALL = .true ]; then + resources/switch/package-master-all.sh + else + resources/switch/package-master.sh + fi + else + if [ .$USE_SWITCH_PACKAGE_ALL = .true ]; then + resources/switch/package-all.sh + else + resources/switch/package-release.sh + fi + fi + + #copy the switch conf files to /etc/freeswitch + resources/switch/conf-copy.sh + + #set the file permissions + resources/switch/package-permissions.sh + + #systemd service + resources/switch/package-systemd.sh + +fi From 75daa2acb2169cf84661ead36bb84368b3d6d308 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 14:14:05 -0700 Subject: [PATCH 24/60] Update config.sh --- debian/resources/config.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/resources/config.sh b/debian/resources/config.sh index ade6348..b4d3725 100644 --- a/debian/resources/config.sh +++ b/debian/resources/config.sh @@ -3,9 +3,10 @@ system_branch=stable # master, stable # FreeSWITCH Settings +switch_branch=stable # master, stable switch_source=false # true or false switch_package=true # true or false -switch_branch=stable # master, stable +switch_package_all=true # true or false # General Settings cpu_architecture=x86 # arm, x86_64 From 858a31f6cf3188a9e3bb821a5c98aba24f0d1da4 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 14:15:36 -0700 Subject: [PATCH 25/60] Update switch.sh --- debian/resources/switch.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/debian/resources/switch.sh b/debian/resources/switch.sh index 55b8e66..1236ac0 100644 --- a/debian/resources/switch.sh +++ b/debian/resources/switch.sh @@ -1,7 +1,13 @@ +#!/bin/sh +#move to script directory so all relative paths work +cd "$(dirname "$0")" -if [ .$USE_SWITCH_SOURCE = .true ]; then - if [ .$USE_SWITCH_MASTER = .true ]; then +#includes +. ./config.sh + +if [ .$switch_source = .true ]; then + if [ ."$switch_branch" = "master" ]; then resources/switch/source-master.sh else resources/switch/source-release.sh @@ -15,16 +21,17 @@ if [ .$USE_SWITCH_SOURCE = .true ]; then #systemd service resources/switch/source-systemd.sh +fi -else - if [ .$USE_SWITCH_MASTER = .true ]; then - if [ .$USE_SWITCH_PACKAGE_ALL = .true ]; then +if [ .$switch_package = .true ]; then + if [ ."$switch_branch" = "master" ]; then + if [ .$switch_package_all = .true ]; then resources/switch/package-master-all.sh else resources/switch/package-master.sh fi else - if [ .$USE_SWITCH_PACKAGE_ALL = .true ]; then + if [ .$switch_package_all = .true ]; then resources/switch/package-all.sh else resources/switch/package-release.sh @@ -39,5 +46,4 @@ else #systemd service resources/switch/package-systemd.sh - fi From c027f6688879c5ead62e59c36c65687d372c151f Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 14:37:11 -0700 Subject: [PATCH 26/60] Update install.sh --- debian/install.sh | 75 ----------------------------------------------- 1 file changed, 75 deletions(-) diff --git a/debian/install.sh b/debian/install.sh index e034a49..406f5ef 100755 --- a/debian/install.sh +++ b/debian/install.sh @@ -8,81 +8,6 @@ cd "$(dirname "$0")" . ./resources/colors.sh . ./resources/arguments.sh -if [ .$CPU_CHECK = .true ] && [ .$USE_SWITCH_SOURCE = .false ]; then - #check what the CPU and OS are - OS_test=$(uname -m) - CPU_arch='unknown' - OS_bits='unknown' - CPU_bits='unknown' - if [ .$OS_test = .'armv7l' ]; then - OS_bits='32' - CPU_bits='32' - # RaspberryPi 3 is actually armv8l but current Raspbian reports the cpu as armv7l and no Raspbian 64Bit has been released at this time - CPU_arch='arm' - elif [ .$OS_test = .'armv8l' ]; then - # We currently have no test case for armv8l - OS_bits='unknown' - CPU_bits='64' - CPU_arch='arm' - elif [ .$OS_test = .'i386' ]; then - OS_bits='32' - if [ .$(grep -o -w 'lm' /proc/cpuinfo | head -n 1) = .'lm' ]; then - CPU_bits='64' - else - CPU_bits='32' - fi - CPU_arch='x86' - elif [ .$OS_test = .'i686' ]; then - OS_bits='32' - if [ .$(grep -o -w 'lm' /proc/cpuinfo | head -n 1) = .'lm' ]; then - CPU_bits='64' - else - CPU_bits='32' - fi - CPU_arch='x86' - elif [ .$OS_test = .'x86_64' ]; then - OS_bits='64' - if [ .$(grep -o -w 'lm' /proc/cpuinfo | head -n 1) = .'lm' ]; then - CPU_bits='64' - else - CPU_bits='32' - fi - CPU_arch='x86' - fi - - if [ .$CPU_arch = .'arm' ]; then - if [ .$OS_bits = .'32' ]; then - export USE_SWITCH_PACKAGE_UNOFFICIAL_ARM=true - verbose "Correct CPU/OS detected, using unofficial arm repo" - elif [ .$OS_bits = .'64' ]; then - error "You are using a 64bit arm OS this is unsupported" - warning " please rerun with --use-switch-source" - exit 3 - else - error "Unknown OS_bits $OS_bits this is unsupported" - warning " please rerun with --use-switch-source" - exit 3 - fi - elif [ .$CPU_arch = .'x86' ]; then - if [ .$OS_bits = .'32' ]; then - error "You are using a 32bit OS this is unsupported" - if [ .$CPU_bits = .'64' ]; then - warning " Your CPU is 64bit you should consider reinstalling with a 64bit OS" - fi - warning " please rerun with --use-switch-source" - exit 3 - elif [ .$OS_bits = .'64' ]; then - verbose "Correct CPU/OS detected" - else - error "Unknown OS_bits $OS_bits this is unsupported" - warning " please rerun with --use-switch-source" - exit 3 - fi - else - error "You are using a unsupported architecture $CPU_arch" - fi -fi - # removes the cd img from the /etc/apt/sources.list file (not needed after base install) sed -i '/cdrom:/d' /etc/apt/sources.list From 001b25e4463253468814c17ebc7c74e6294f5717 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 15:02:29 -0700 Subject: [PATCH 27/60] Update config.sh --- debian/resources/config.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/debian/resources/config.sh b/debian/resources/config.sh index b4d3725..3de9ae0 100644 --- a/debian/resources/config.sh +++ b/debian/resources/config.sh @@ -9,8 +9,6 @@ switch_package=true # true or false switch_package_all=true # true or false # General Settings -cpu_architecture=x86 # arm, x86_64 -cpu_mode=64 # 32 or 64 bit php_version=5 # PHP version 5 or 7 database_repo=official # PostgresSQL official, system, 2ndquadrant web_server_name=nginx # nginx From 9825fb6f2d27e5dfc4965e9f0704820cef094682 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 15:09:21 -0700 Subject: [PATCH 28/60] Create environment.sh --- debian/resources/environment.sh | 76 +++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 debian/resources/environment.sh diff --git a/debian/resources/environment.sh b/debian/resources/environment.sh new file mode 100644 index 0000000..624edf9 --- /dev/null +++ b/debian/resources/environment.sh @@ -0,0 +1,76 @@ +#!/bin/sh + +#check what the CPU and OS are +cpu_name=$(uname -m) +cpu_architecture='unknown' +cpu_mode='unknown' +os_mode = 'unknown' + +if [ .$cpu_name = .'armv7l' ]; then + # RaspberryPi 3 is actually armv8l but current Raspbian reports the cpu as armv7l and no Raspbian 64Bit has been released at this time + os_mode='32' + cpu_mode='32' + cpu_architecture='arm' +elif [ .$cpu_name = .'armv8l' ]; then + # No test case for armv8l + os_mode='unknown' + cpu_mode='64' + cpu_architecture='arm' +elif [ .$cpu_name = .'i386' ]; then + os_mode='32' + if [ .$(grep -o -w 'lm' /proc/cpuinfo | head -n 1) = .'lm' ]; then + cpu_mode='64' + else + cpu_mode='32' + fi + cpu_architecture='x86' +elif [ .$cpu_name = .'i686' ]; then + os_mode='32' + if [ .$(grep -o -w 'lm' /proc/cpuinfo | head -n 1) = .'lm' ]; then + cpu_mode='64' + else + cpu_mode='32' + fi + cpu_architecture='x86' +elif [ .$cpu_name = .'x86_64' ]; then + os_mode='64' + if [ .$(grep -o -w 'lm' /proc/cpuinfo | head -n 1) = .'lm' ]; then + cpu_mode='64' + else + cpu_mode='32' + fi + cpu_architecture='x86' +fi + + +if [ .$cpu_architecture = .'arm' ]; then + if [ .$os_mode = .'32' ]; then + #export USE_SWITCH_PACKAGE_UNOFFICIAL_ARM=true + verbose "Correct CPU/OS detected, using unofficial arm repo" + elif [ .$os_mode = .'64' ]; then + error "You are using a 64bit arm OS this is unsupported" + warning " please rerun with --use-switch-source" + exit 3 + else + error "Unknown OS_bits $OS_bits this is unsupported" + warning " please rerun with --use-switch-source" + exit 3 + fi +elif [ .$cpu_architecture = .'x86' ]; then + if [ .$os_mode = .'32' ]; then + error "You are using a 32bit OS this is unsupported" + if [ .$cpu_mode = .'64' ]; then + warning " Your CPU is 64bit you should consider reinstalling with a 64bit OS" + fi + warning " please rerun with --use-switch-source" + exit 3 + elif [ .$os_mode = .'64' ]; then + verbose "Correct CPU/OS detected" + else + error "Unknown OS_bits $OS_bits this is unsupported" + warning " please rerun with --use-switch-source" + exit 3 + fi +else + error "You are using a unsupported architecture $cpu_architecture" +fi From 08ebc280b1db2d55865b94e4e9f22d50a22bef5f Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 15:10:20 -0700 Subject: [PATCH 29/60] Update install.sh --- debian/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/install.sh b/debian/install.sh index 406f5ef..795356c 100755 --- a/debian/install.sh +++ b/debian/install.sh @@ -6,7 +6,7 @@ cd "$(dirname "$0")" #includes . ./resources/config.sh . ./resources/colors.sh -. ./resources/arguments.sh +. ./resources/environment.sh # removes the cd img from the /etc/apt/sources.list file (not needed after base install) sed -i '/cdrom:/d' /etc/apt/sources.list From 1a4677862358430679f3cdb4bee38f0df3bb6080 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 15:20:28 -0700 Subject: [PATCH 30/60] Update environment.sh --- debian/resources/environment.sh | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/debian/resources/environment.sh b/debian/resources/environment.sh index 624edf9..c88cc3c 100644 --- a/debian/resources/environment.sh +++ b/debian/resources/environment.sh @@ -42,19 +42,17 @@ elif [ .$cpu_name = .'x86_64' ]; then cpu_architecture='x86' fi - if [ .$cpu_architecture = .'arm' ]; then if [ .$os_mode = .'32' ]; then - #export USE_SWITCH_PACKAGE_UNOFFICIAL_ARM=true - verbose "Correct CPU/OS detected, using unofficial arm repo" + verbose "Correct CPU and Operating System detected, using the ARM repo" elif [ .$os_mode = .'64' ]; then error "You are using a 64bit arm OS this is unsupported" - warning " please rerun with --use-switch-source" - exit 3 + switch_source=true + switch_package=false else - error "Unknown OS_bits $OS_bits this is unsupported" - warning " please rerun with --use-switch-source" - exit 3 + error "Unknown OS mode $os_mode this is unsupported" + switch_source=true + switch_package=false fi elif [ .$cpu_architecture = .'x86' ]; then if [ .$os_mode = .'32' ]; then @@ -62,15 +60,16 @@ elif [ .$cpu_architecture = .'x86' ]; then if [ .$cpu_mode = .'64' ]; then warning " Your CPU is 64bit you should consider reinstalling with a 64bit OS" fi - warning " please rerun with --use-switch-source" - exit 3 + switch_source=true + switch_package=false elif [ .$os_mode = .'64' ]; then - verbose "Correct CPU/OS detected" + verbose "Correct CPU and Operating System detected" else - error "Unknown OS_bits $OS_bits this is unsupported" - warning " please rerun with --use-switch-source" - exit 3 + error "Unknown Operating System mode $os_mode is unsupported" + switch_source=true + switch_package=false fi else error "You are using a unsupported architecture $cpu_architecture" + exit 3 fi From ef246401500012aaddfb9ff263cb120bb8bc49b9 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 20:17:13 -0700 Subject: [PATCH 31/60] Update nginx.sh --- debian/resources/nginx.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/resources/nginx.sh b/debian/resources/nginx.sh index aba7baf..d17ae2a 100755 --- a/debian/resources/nginx.sh +++ b/debian/resources/nginx.sh @@ -14,7 +14,7 @@ verbose "Installing the web server" arch=$(uname -m) real_os=$(lsb_release -is) codename=$(lsb_release -cs) -if [ .$cpu_architecture = "arm" ]; then +if [ ."$cpu_architecture" = "arm" ]; then #9.x - */stretch/ #8.x - */jessie/ fi @@ -23,18 +23,18 @@ if [ ."$php_version" = ."5" ]; then #which add-apt-repository || apt-get install -y software-properties-common #LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php #LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php5-compat -elif [ .$real_os = .'Ubuntu' ]; then +elif [ ."$real_os" = .'Ubuntu' ]; then #16.10.x - */yakkety/ #16.04.x - */xenial/ #14.04.x - */trusty/ - if [ .$codename = .'trusty' ]; then + if [ ."$codename" = .'trusty' ]; then which add-apt-repository || apt-get install -y software-properties-common LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php fi else #9.x - */stretch/ #8.x - */jessie/ - if [ .$codename = .'jessie' ]; then + if [ ."$codename" = .'jessie' ]; then echo "deb http://packages.dotdeb.org $codename all" > /etc/apt/sources.list.d/dotdeb.list echo "deb-src http://packages.dotdeb.org $codename all" >> /etc/apt/sources.list.d/dotdeb.list wget -O - https://www.dotdeb.org/dotdeb.gpg | apt-key add - From 2e504d9ac2bacf03c399c6369d8b46a451fe71f4 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 20:21:05 -0700 Subject: [PATCH 32/60] Update nginx.sh --- debian/resources/nginx.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/debian/resources/nginx.sh b/debian/resources/nginx.sh index d17ae2a..ffa6a4a 100755 --- a/debian/resources/nginx.sh +++ b/debian/resources/nginx.sh @@ -14,27 +14,27 @@ verbose "Installing the web server" arch=$(uname -m) real_os=$(lsb_release -is) codename=$(lsb_release -cs) -if [ ."$cpu_architecture" = "arm" ]; then +if [ ."$cpu_architecture" = "arm" ] then #9.x - */stretch/ #8.x - */jessie/ fi -if [ ."$php_version" = ."5" ]; then +if [ ."$php_version" = ."5" ] then #verbose "Switching forcefully to php5* packages" #which add-apt-repository || apt-get install -y software-properties-common #LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php #LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php5-compat -elif [ ."$real_os" = .'Ubuntu' ]; then +elif [ ."$real_os" = .'Ubuntu' ] then #16.10.x - */yakkety/ #16.04.x - */xenial/ #14.04.x - */trusty/ - if [ ."$codename" = .'trusty' ]; then + if [ ."$codename" = .'trusty' ] then which add-apt-repository || apt-get install -y software-properties-common LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php fi else #9.x - */stretch/ #8.x - */jessie/ - if [ ."$codename" = .'jessie' ]; then + if [ ."$codename" = .'jessie' ] then echo "deb http://packages.dotdeb.org $codename all" > /etc/apt/sources.list.d/dotdeb.list echo "deb-src http://packages.dotdeb.org $codename all" >> /etc/apt/sources.list.d/dotdeb.list wget -O - https://www.dotdeb.org/dotdeb.gpg | apt-key add - @@ -44,20 +44,20 @@ apt-get update #install dependencies apt-get install -y nginx -if [ ."$php_version" = ."5" ]; then +if [ ."$php_version" = ."5" ] then apt-get install -y php5 php5-cli php5-fpm php5-pgsql php5-sqlite php5-odbc php5-curl php5-imap php5-mcrypt fi -if [ ."$php_version" = ."7" ]; then +if [ ."$php_version" = ."7" ] then apt-get install -y php7.0 php7.0-cli php7.0-fpm php7.0-pgsql php7.0-sqlite3 php7.0-odbc php7.0-curl php7.0-imap php7.0-mcrypt php7.0-xml fi #enable fusionpbx nginx config cp nginx/fusionpbx /etc/nginx/sites-available/fusionpbx #prepare socket name -if [ ."$php_version" = ."5" ]; then +if [ ."$php_version" = ."5" ] then sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php5-fpm.sock;#g' fi -if [ ."$php_version" = ."7" ]; then +if [ ."$php_version" = ."7" ] then sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php/php7.0-fpm.sock;#g' fi ln -s /etc/nginx/sites-available/fusionpbx /etc/nginx/sites-enabled/fusionpbx From 36bf77b1b607bd87468b1726e4719cc9dcb79489 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 20:22:37 -0700 Subject: [PATCH 33/60] Update nginx.sh --- debian/resources/nginx.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/resources/nginx.sh b/debian/resources/nginx.sh index ffa6a4a..5fd8f60 100755 --- a/debian/resources/nginx.sh +++ b/debian/resources/nginx.sh @@ -14,7 +14,7 @@ verbose "Installing the web server" arch=$(uname -m) real_os=$(lsb_release -is) codename=$(lsb_release -cs) -if [ ."$cpu_architecture" = "arm" ] then +if [ ."$cpu_architecture" = ."arm" ] then #9.x - */stretch/ #8.x - */jessie/ fi @@ -23,18 +23,18 @@ if [ ."$php_version" = ."5" ] then #which add-apt-repository || apt-get install -y software-properties-common #LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php #LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php5-compat -elif [ ."$real_os" = .'Ubuntu' ] then +elif [ ."$real_os" = ."Ubuntu" ] then #16.10.x - */yakkety/ #16.04.x - */xenial/ #14.04.x - */trusty/ - if [ ."$codename" = .'trusty' ] then + if [ ."$codename" = ."trusty" ] then which add-apt-repository || apt-get install -y software-properties-common LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php fi else #9.x - */stretch/ #8.x - */jessie/ - if [ ."$codename" = .'jessie' ] then + if [ ."$codename" = ."jessie" ] then echo "deb http://packages.dotdeb.org $codename all" > /etc/apt/sources.list.d/dotdeb.list echo "deb-src http://packages.dotdeb.org $codename all" >> /etc/apt/sources.list.d/dotdeb.list wget -O - https://www.dotdeb.org/dotdeb.gpg | apt-key add - From 4065e304009369774ca6a938059959383dd857f1 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 21:11:08 -0700 Subject: [PATCH 34/60] Update nginx.sh --- debian/resources/nginx.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/debian/resources/nginx.sh b/debian/resources/nginx.sh index 5fd8f60..afad51c 100755 --- a/debian/resources/nginx.sh +++ b/debian/resources/nginx.sh @@ -14,27 +14,27 @@ verbose "Installing the web server" arch=$(uname -m) real_os=$(lsb_release -is) codename=$(lsb_release -cs) -if [ ."$cpu_architecture" = ."arm" ] then +if [ ."$cpu_architecture" = ."arm" ]; then #9.x - */stretch/ #8.x - */jessie/ fi -if [ ."$php_version" = ."5" ] then +if [ ."$php_version" = ."5" ]; then #verbose "Switching forcefully to php5* packages" - #which add-apt-repository || apt-get install -y software-properties-common + which add-apt-repository || apt-get install -y software-properties-common #LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php #LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php5-compat -elif [ ."$real_os" = ."Ubuntu" ] then +elif [ ."$real_os" = ."Ubuntu" ]; then #16.10.x - */yakkety/ #16.04.x - */xenial/ #14.04.x - */trusty/ - if [ ."$codename" = ."trusty" ] then + if [ ."$codename" = ."trusty" ]; then which add-apt-repository || apt-get install -y software-properties-common LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php fi else #9.x - */stretch/ #8.x - */jessie/ - if [ ."$codename" = ."jessie" ] then + if [ ."$codename" = ."jessie" ]; then echo "deb http://packages.dotdeb.org $codename all" > /etc/apt/sources.list.d/dotdeb.list echo "deb-src http://packages.dotdeb.org $codename all" >> /etc/apt/sources.list.d/dotdeb.list wget -O - https://www.dotdeb.org/dotdeb.gpg | apt-key add - @@ -44,20 +44,20 @@ apt-get update #install dependencies apt-get install -y nginx -if [ ."$php_version" = ."5" ] then +if [ ."$php_version" = ."5" ]; then apt-get install -y php5 php5-cli php5-fpm php5-pgsql php5-sqlite php5-odbc php5-curl php5-imap php5-mcrypt fi -if [ ."$php_version" = ."7" ] then +if [ ."$php_version" = ."7" ]; then apt-get install -y php7.0 php7.0-cli php7.0-fpm php7.0-pgsql php7.0-sqlite3 php7.0-odbc php7.0-curl php7.0-imap php7.0-mcrypt php7.0-xml fi #enable fusionpbx nginx config cp nginx/fusionpbx /etc/nginx/sites-available/fusionpbx #prepare socket name -if [ ."$php_version" = ."5" ] then +if [ ."$php_version" = ."5" ]; then sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php5-fpm.sock;#g' fi -if [ ."$php_version" = ."7" ] then +if [ ."$php_version" = ."7" ]; then sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php/php7.0-fpm.sock;#g' fi ln -s /etc/nginx/sites-available/fusionpbx /etc/nginx/sites-enabled/fusionpbx From 497ac5f102eef1a186c9506631ec7606ad62053a Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 21:19:30 -0700 Subject: [PATCH 35/60] Update nginx.sh --- debian/resources/nginx.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/resources/nginx.sh b/debian/resources/nginx.sh index afad51c..6ac9304 100755 --- a/debian/resources/nginx.sh +++ b/debian/resources/nginx.sh @@ -14,10 +14,10 @@ verbose "Installing the web server" arch=$(uname -m) real_os=$(lsb_release -is) codename=$(lsb_release -cs) -if [ ."$cpu_architecture" = ."arm" ]; then +#if [ ."$cpu_architecture" = ."arm" ]; then #9.x - */stretch/ #8.x - */jessie/ -fi +#fi if [ ."$php_version" = ."5" ]; then #verbose "Switching forcefully to php5* packages" which add-apt-repository || apt-get install -y software-properties-common From 6c4959133ed81e36740394662aa9c4ff4dd7ca34 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 21:58:27 -0700 Subject: [PATCH 36/60] Update switch.sh --- debian/resources/switch.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/debian/resources/switch.sh b/debian/resources/switch.sh index 1236ac0..a7d47f1 100644 --- a/debian/resources/switch.sh +++ b/debian/resources/switch.sh @@ -8,42 +8,42 @@ cd "$(dirname "$0")" if [ .$switch_source = .true ]; then if [ ."$switch_branch" = "master" ]; then - resources/switch/source-master.sh + switch/source-master.sh else - resources/switch/source-release.sh + switch/source-release.sh fi #copy the switch conf files to /etc/freeswitch - resources/switch/conf-copy.sh + switch/conf-copy.sh #set the file permissions - resources/switch/source-permissions.sh + switch/source-permissions.sh #systemd service - resources/switch/source-systemd.sh + switch/source-systemd.sh fi if [ .$switch_package = .true ]; then if [ ."$switch_branch" = "master" ]; then if [ .$switch_package_all = .true ]; then - resources/switch/package-master-all.sh + switch/package-master-all.sh else - resources/switch/package-master.sh + switch/package-master.sh fi else if [ .$switch_package_all = .true ]; then - resources/switch/package-all.sh + switch/package-all.sh else - resources/switch/package-release.sh + switch/package-release.sh fi fi #copy the switch conf files to /etc/freeswitch - resources/switch/conf-copy.sh + switch/conf-copy.sh #set the file permissions - resources/switch/package-permissions.sh + switch/package-permissions.sh #systemd service - resources/switch/package-systemd.sh + switch/package-systemd.sh fi From d481c3f9ebdf5bb0d71522746437db76615c681e Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 22:10:54 -0700 Subject: [PATCH 37/60] Update config.sh --- debian/resources/config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/resources/config.sh b/debian/resources/config.sh index 3de9ae0..056e9a1 100644 --- a/debian/resources/config.sh +++ b/debian/resources/config.sh @@ -6,7 +6,7 @@ system_branch=stable # master, stable switch_branch=stable # master, stable switch_source=false # true or false switch_package=true # true or false -switch_package_all=true # true or false +switch_package_all=false # true or false # General Settings php_version=5 # PHP version 5 or 7 From 2e93c4ca8315a5f06ffb4ecb9ffa6d652e63f8f6 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 22:52:41 -0700 Subject: [PATCH 38/60] Update config.sh --- debian/resources/config.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/debian/resources/config.sh b/debian/resources/config.sh index 056e9a1..9524d46 100644 --- a/debian/resources/config.sh +++ b/debian/resources/config.sh @@ -6,7 +6,6 @@ system_branch=stable # master, stable switch_branch=stable # master, stable switch_source=false # true or false switch_package=true # true or false -switch_package_all=false # true or false # General Settings php_version=5 # PHP version 5 or 7 From 1e93083666cda54cad28ff9f83e20a4143af972e Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 23:04:04 -0700 Subject: [PATCH 39/60] Update package-release.sh --- debian/resources/switch/package-release.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/resources/switch/package-release.sh b/debian/resources/switch/package-release.sh index 11861e8..33a22ba 100755 --- a/debian/resources/switch/package-release.sh +++ b/debian/resources/switch/package-release.sh @@ -3,12 +3,13 @@ #move to script directory so all relative paths work cd "$(dirname "$0")" +. ../config.sh . ../colors.sh +. ../environment.sh . ../arguments.sh apt-get update && apt-get install -y --force-yes curl memcached haveged -arch=$(uname -m) -if [ $arch = 'armv7l' ] && [ $USE_SWITCH_PACKAGE_UNOFFICIAL_ARM = true ]; then +if [ ."$cpu_architecture" = ."arm" ]; 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 - else From a6049ad17fc6d2f23e688024c0ab984740efdee9 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 4 Mar 2017 23:06:30 -0700 Subject: [PATCH 40/60] Update package-all.sh --- debian/resources/switch/package-all.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/debian/resources/switch/package-all.sh b/debian/resources/switch/package-all.sh index a21042b..5573fba 100755 --- a/debian/resources/switch/package-all.sh +++ b/debian/resources/switch/package-all.sh @@ -1,11 +1,13 @@ #!/bin/sh -#initialize variable encase we are called directly -[ -z $USE_SWITCH_PACKAGE_UNOFFICIAL_ARM ] && USE_SWITCH_PACKAGE_UNOFFICIAL_ARM=false +. ../config.sh +. ../colors.sh +. ../environment.sh +. ../arguments.sh apt-get update && apt-get install -y --force-yes ntp curl memcached haveged -arch=$(uname -m) -if [ $arch = 'armv7l' ] && [ $USE_SWITCH_PACKAGE_UNOFFICIAL_ARM = true ]; then + +if [ ."$cpu_architecture" = ."arm" ]; 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 - else From 16451807dd23c9559445f68cbf29a0dfde6e990d Mon Sep 17 00:00:00 2001 From: root Date: Sun, 5 Mar 2017 06:11:42 +0000 Subject: [PATCH 41/60] update the file permissions --- debian/resources/backup/fusionpbx-backup.sh | 0 debian/resources/config.sh | 0 debian/resources/environment.sh | 0 debian/resources/fail2ban/freeswitch-404.conf | 0 debian/resources/fail2ban/freeswitch-dos.conf | 0 debian/resources/fail2ban/freeswitch-ip.conf | 0 debian/resources/fail2ban/freeswitch.conf | 0 debian/resources/fail2ban/fusionpbx.conf | 0 debian/resources/fail2ban/jail.local | 0 debian/resources/fail2ban/nginx-404.conf | 0 debian/resources/fail2ban/nginx-dos.conf | 0 debian/resources/fusionpbx/config.php | 0 debian/resources/letsencrypt.sh | 0 debian/resources/letsencrypt/domain_name.conf | 0 debian/resources/nginx/fusionpbx | 0 debian/resources/reboot_phones.sh | 0 debian/resources/switch.sh | 0 debian/resources/switch/source/etc.default.freeswitch | 0 debian/resources/switch/source/freeswitch.service.package | 0 debian/resources/switch/source/freeswitch.service.source | 0 20 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 debian/resources/backup/fusionpbx-backup.sh mode change 100644 => 100755 debian/resources/config.sh mode change 100644 => 100755 debian/resources/environment.sh mode change 100644 => 100755 debian/resources/fail2ban/freeswitch-404.conf mode change 100644 => 100755 debian/resources/fail2ban/freeswitch-dos.conf mode change 100644 => 100755 debian/resources/fail2ban/freeswitch-ip.conf mode change 100644 => 100755 debian/resources/fail2ban/freeswitch.conf mode change 100644 => 100755 debian/resources/fail2ban/fusionpbx.conf mode change 100644 => 100755 debian/resources/fail2ban/jail.local mode change 100644 => 100755 debian/resources/fail2ban/nginx-404.conf mode change 100644 => 100755 debian/resources/fail2ban/nginx-dos.conf mode change 100644 => 100755 debian/resources/fusionpbx/config.php mode change 100644 => 100755 debian/resources/letsencrypt.sh mode change 100644 => 100755 debian/resources/letsencrypt/domain_name.conf mode change 100644 => 100755 debian/resources/nginx/fusionpbx mode change 100644 => 100755 debian/resources/reboot_phones.sh mode change 100644 => 100755 debian/resources/switch.sh mode change 100644 => 100755 debian/resources/switch/source/etc.default.freeswitch mode change 100644 => 100755 debian/resources/switch/source/freeswitch.service.package mode change 100644 => 100755 debian/resources/switch/source/freeswitch.service.source diff --git a/debian/resources/backup/fusionpbx-backup.sh b/debian/resources/backup/fusionpbx-backup.sh old mode 100644 new mode 100755 diff --git a/debian/resources/config.sh b/debian/resources/config.sh old mode 100644 new mode 100755 diff --git a/debian/resources/environment.sh b/debian/resources/environment.sh old mode 100644 new mode 100755 diff --git a/debian/resources/fail2ban/freeswitch-404.conf b/debian/resources/fail2ban/freeswitch-404.conf old mode 100644 new mode 100755 diff --git a/debian/resources/fail2ban/freeswitch-dos.conf b/debian/resources/fail2ban/freeswitch-dos.conf old mode 100644 new mode 100755 diff --git a/debian/resources/fail2ban/freeswitch-ip.conf b/debian/resources/fail2ban/freeswitch-ip.conf old mode 100644 new mode 100755 diff --git a/debian/resources/fail2ban/freeswitch.conf b/debian/resources/fail2ban/freeswitch.conf old mode 100644 new mode 100755 diff --git a/debian/resources/fail2ban/fusionpbx.conf b/debian/resources/fail2ban/fusionpbx.conf old mode 100644 new mode 100755 diff --git a/debian/resources/fail2ban/jail.local b/debian/resources/fail2ban/jail.local old mode 100644 new mode 100755 diff --git a/debian/resources/fail2ban/nginx-404.conf b/debian/resources/fail2ban/nginx-404.conf old mode 100644 new mode 100755 diff --git a/debian/resources/fail2ban/nginx-dos.conf b/debian/resources/fail2ban/nginx-dos.conf old mode 100644 new mode 100755 diff --git a/debian/resources/fusionpbx/config.php b/debian/resources/fusionpbx/config.php old mode 100644 new mode 100755 diff --git a/debian/resources/letsencrypt.sh b/debian/resources/letsencrypt.sh old mode 100644 new mode 100755 diff --git a/debian/resources/letsencrypt/domain_name.conf b/debian/resources/letsencrypt/domain_name.conf old mode 100644 new mode 100755 diff --git a/debian/resources/nginx/fusionpbx b/debian/resources/nginx/fusionpbx old mode 100644 new mode 100755 diff --git a/debian/resources/reboot_phones.sh b/debian/resources/reboot_phones.sh old mode 100644 new mode 100755 diff --git a/debian/resources/switch.sh b/debian/resources/switch.sh old mode 100644 new mode 100755 diff --git a/debian/resources/switch/source/etc.default.freeswitch b/debian/resources/switch/source/etc.default.freeswitch old mode 100644 new mode 100755 diff --git a/debian/resources/switch/source/freeswitch.service.package b/debian/resources/switch/source/freeswitch.service.package old mode 100644 new mode 100755 diff --git a/debian/resources/switch/source/freeswitch.service.source b/debian/resources/switch/source/freeswitch.service.source old mode 100644 new mode 100755 From f00386e126bf2937be69914e512b6e4df154a2c3 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 5 Mar 2017 10:12:06 -0700 Subject: [PATCH 42/60] Update environment.sh --- debian/resources/environment.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/resources/environment.sh b/debian/resources/environment.sh index c88cc3c..b563498 100755 --- a/debian/resources/environment.sh +++ b/debian/resources/environment.sh @@ -4,7 +4,7 @@ cpu_name=$(uname -m) cpu_architecture='unknown' cpu_mode='unknown' -os_mode = 'unknown' +os_mode='unknown' if [ .$cpu_name = .'armv7l' ]; then # RaspberryPi 3 is actually armv8l but current Raspbian reports the cpu as armv7l and no Raspbian 64Bit has been released at this time From 490cbd1c2b70051dbbdc904fee9291456ef2f106 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 5 Mar 2017 10:30:59 -0700 Subject: [PATCH 43/60] Update nginx.sh --- debian/resources/nginx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/resources/nginx.sh b/debian/resources/nginx.sh index 6ac9304..8f6a224 100755 --- a/debian/resources/nginx.sh +++ b/debian/resources/nginx.sh @@ -6,7 +6,7 @@ cd "$(dirname "$0")" #includes . ./config.sh . ./colors.sh -. ./arguments.sh +. ./environment.sh #send a message verbose "Installing the web server" From 868b1a5d1254652bd2664bac23fcb34a15b773c1 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 5 Mar 2017 10:42:12 -0700 Subject: [PATCH 44/60] Update nginx.sh --- debian/resources/nginx.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/resources/nginx.sh b/debian/resources/nginx.sh index 8f6a224..6f3152d 100755 --- a/debian/resources/nginx.sh +++ b/debian/resources/nginx.sh @@ -11,9 +11,10 @@ cd "$(dirname "$0")" #send a message verbose "Installing the web server" -arch=$(uname -m) + real_os=$(lsb_release -is) codename=$(lsb_release -cs) + #if [ ."$cpu_architecture" = ."arm" ]; then #9.x - */stretch/ #8.x - */jessie/ @@ -42,6 +43,11 @@ else fi apt-get update +#use php version 5 for arm +if [ .$cpu_architecture = .'arm' ]; then + php_version=5 +fi + #install dependencies apt-get install -y nginx if [ ."$php_version" = ."5" ]; then From b400af5bffa751a0769ca920247c3f1d3255545a Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 5 Mar 2017 10:45:03 -0700 Subject: [PATCH 45/60] Update postgres.sh --- debian/resources/postgres.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/resources/postgres.sh b/debian/resources/postgres.sh index 026458d..e31da83 100755 --- a/debian/resources/postgres.sh +++ b/debian/resources/postgres.sh @@ -5,6 +5,8 @@ cd "$(dirname "$0")" #includes . ./config.sh +. ./colors.sh +. ./environment.sh #send a message echo "Install PostgreSQL" @@ -15,6 +17,11 @@ password=$(dd if=/dev/urandom bs=1 count=20 2>/dev/null | base64) #install message echo "Install PostgreSQL and create the database and users\n" +#use the system database repo for arm +if [ .$cpu_architecture = .'arm' ]; then + database_repo="system" +fi + #included in the distribution if [ ."$database_repo" = ."system" ]; then apt-get install -y --force-yes sudo postgresql From 7ad32f29dc5f1970a292f6fcc28909106d53eb03 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 5 Mar 2017 10:50:21 -0700 Subject: [PATCH 46/60] Update finish.sh --- debian/resources/finish.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/debian/resources/finish.sh b/debian/resources/finish.sh index c86207e..48d13dd 100755 --- a/debian/resources/finish.sh +++ b/debian/resources/finish.sh @@ -94,12 +94,11 @@ echo " If you need to login to a different domain then use username@domain." echo " username: $user_name@$domain_name"; echo "" echo " Official FusionPBX Training" -echo " Fastest and best way to learn FusionPBX." +echo " Fastest way to learn FusionPBX. For more information https://www.fusionpbx.com." echo " Admin Training 27 - 28 March (2 Days)" echo " Advanced Training 29 - 30 March (2 Days)" echo " Timezone: https://www.timeanddate.com/worldclock/usa/boise" echo " Available online and in person. Includes documentation and recording." -echo " For more information visit https://www.fusionpbx.com" echo "" echo " Additional information." echo " https://fusionpbx.com/support.php" From 24810b26f6cc60ff29746778cb509072a0a1aa71 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 5 Mar 2017 10:54:12 -0700 Subject: [PATCH 47/60] Update config.sh --- debian/resources/config.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/resources/config.sh b/debian/resources/config.sh index 9524d46..5711a8b 100755 --- a/debian/resources/config.sh +++ b/debian/resources/config.sh @@ -10,4 +10,5 @@ switch_package=true # true or false # General Settings php_version=5 # PHP version 5 or 7 database_repo=official # PostgresSQL official, system, 2ndquadrant +database_backup=false # true or false web_server_name=nginx # nginx From 010704f198d3486780d3e3ae4db93d6fba448865 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 5 Mar 2017 11:01:37 -0700 Subject: [PATCH 48/60] Update environment.sh --- debian/resources/environment.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/debian/resources/environment.sh b/debian/resources/environment.sh index b563498..66b2d6a 100755 --- a/debian/resources/environment.sh +++ b/debian/resources/environment.sh @@ -1,10 +1,14 @@ #!/bin/sh -#check what the CPU and OS are +#operating system details +os_mode='unknown' +os_name=$(lsb_release -is) +os_codename=$(lsb_release -cs) + +#cpu details cpu_name=$(uname -m) cpu_architecture='unknown' cpu_mode='unknown' -os_mode='unknown' if [ .$cpu_name = .'armv7l' ]; then # RaspberryPi 3 is actually armv8l but current Raspbian reports the cpu as armv7l and no Raspbian 64Bit has been released at this time From 71490c8759b2d5e012bfaea09fd52744195f53c2 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 5 Mar 2017 11:04:41 -0700 Subject: [PATCH 49/60] Update nginx.sh --- debian/resources/nginx.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/debian/resources/nginx.sh b/debian/resources/nginx.sh index 6f3152d..2452d8c 100755 --- a/debian/resources/nginx.sh +++ b/debian/resources/nginx.sh @@ -11,10 +11,6 @@ cd "$(dirname "$0")" #send a message verbose "Installing the web server" - -real_os=$(lsb_release -is) -codename=$(lsb_release -cs) - #if [ ."$cpu_architecture" = ."arm" ]; then #9.x - */stretch/ #8.x - */jessie/ @@ -24,18 +20,18 @@ if [ ."$php_version" = ."5" ]; then which add-apt-repository || apt-get install -y software-properties-common #LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php #LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php5-compat -elif [ ."$real_os" = ."Ubuntu" ]; then +elif [ ."$os_name" = ."Ubuntu" ]; then #16.10.x - */yakkety/ #16.04.x - */xenial/ #14.04.x - */trusty/ - if [ ."$codename" = ."trusty" ]; then + if [ ."$os_codename" = ."trusty" ]; then which add-apt-repository || apt-get install -y software-properties-common LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php fi else #9.x - */stretch/ #8.x - */jessie/ - if [ ."$codename" = ."jessie" ]; then + if [ ."$os_codename" = ."jessie" ]; then echo "deb http://packages.dotdeb.org $codename all" > /etc/apt/sources.list.d/dotdeb.list echo "deb-src http://packages.dotdeb.org $codename all" >> /etc/apt/sources.list.d/dotdeb.list wget -O - https://www.dotdeb.org/dotdeb.gpg | apt-key add - @@ -59,6 +55,7 @@ fi #enable fusionpbx nginx config cp nginx/fusionpbx /etc/nginx/sites-available/fusionpbx + #prepare socket name if [ ."$php_version" = ."5" ]; then sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php5-fpm.sock;#g' From 20af35edffe0eb03067c2b2802d6deee2e72dbf9 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 5 Mar 2017 11:05:17 -0700 Subject: [PATCH 50/60] Update environment.sh --- debian/resources/environment.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/resources/environment.sh b/debian/resources/environment.sh index 66b2d6a..5ec856b 100755 --- a/debian/resources/environment.sh +++ b/debian/resources/environment.sh @@ -1,9 +1,9 @@ #!/bin/sh #operating system details -os_mode='unknown' os_name=$(lsb_release -is) os_codename=$(lsb_release -cs) +os_mode='unknown' #cpu details cpu_name=$(uname -m) From 094235a6db137835bdc729d32bad5b431da7f0f7 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 5 Mar 2017 11:25:06 -0700 Subject: [PATCH 51/60] Update postgres.sh --- debian/resources/postgres.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/debian/resources/postgres.sh b/debian/resources/postgres.sh index e31da83..c27f091 100755 --- a/debian/resources/postgres.sh +++ b/debian/resources/postgres.sh @@ -52,12 +52,20 @@ systemctl restart postgresql #init.d #/usr/sbin/service postgresql restart +#enable and run the backup +cp backup/fusionpbx-backup.sh /etc/cron.daily +chmod 755 /etc/cron.daily/fusionpbx-backup.sh +sed -i 's/zzz/$password/g' /etc/cron.daily/fusionpbx-backup.sh +/etc/cron.daily/fusionpbx-backup.sh + #move to /tmp to prevent a red herring error when running sudo with psql cwd=$(pwd) cd /tmp #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 "DROP SCHEMA public cascade;"; +sudo -u postgres psql -c "CREATE SCHEMA public;"; +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;" From 5f153ccbf5594d3023e87b0e4ff234cd7b449841 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 5 Mar 2017 11:50:21 -0700 Subject: [PATCH 52/60] Update postgres.sh --- debian/resources/postgres.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/resources/postgres.sh b/debian/resources/postgres.sh index c27f091..2d02411 100755 --- a/debian/resources/postgres.sh +++ b/debian/resources/postgres.sh @@ -55,7 +55,7 @@ systemctl restart postgresql #enable and run the backup cp backup/fusionpbx-backup.sh /etc/cron.daily chmod 755 /etc/cron.daily/fusionpbx-backup.sh -sed -i 's/zzz/$password/g' /etc/cron.daily/fusionpbx-backup.sh +sed -i "s/zzz/$password/g" /etc/cron.daily/fusionpbx-backup.sh /etc/cron.daily/fusionpbx-backup.sh #move to /tmp to prevent a red herring error when running sudo with psql From ece8a94af9ae12bc214e025c2b4b30d8ca9c9ef3 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 5 Mar 2017 12:20:19 -0700 Subject: [PATCH 53/60] Update postgres.sh --- debian/resources/postgres.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/debian/resources/postgres.sh b/debian/resources/postgres.sh index 2d02411..9e2160a 100755 --- a/debian/resources/postgres.sh +++ b/debian/resources/postgres.sh @@ -52,11 +52,10 @@ systemctl restart postgresql #init.d #/usr/sbin/service postgresql restart -#enable and run the backup +#install the database backup cp backup/fusionpbx-backup.sh /etc/cron.daily chmod 755 /etc/cron.daily/fusionpbx-backup.sh sed -i "s/zzz/$password/g" /etc/cron.daily/fusionpbx-backup.sh -/etc/cron.daily/fusionpbx-backup.sh #move to /tmp to prevent a red herring error when running sudo with psql cwd=$(pwd) From 105aa72c6011e6cc52c7e27d3c58ba44739354ef Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 5 Mar 2017 21:36:40 -0700 Subject: [PATCH 54/60] Update fail2ban.sh --- debian/resources/fail2ban.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/resources/fail2ban.sh b/debian/resources/fail2ban.sh index 7e7584c..c673734 100755 --- a/debian/resources/fail2ban.sh +++ b/debian/resources/fail2ban.sh @@ -6,7 +6,7 @@ cd "$(dirname "$0")" #includes . ./config.sh . ./colors.sh -. ./arguments.sh +. ./environment.sh #send a message verbose "Installing Fail2ban" From 735a97e125312ad8464ab77915aa7665f778c046 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 5 Mar 2017 21:37:29 -0700 Subject: [PATCH 55/60] Update finish.sh --- debian/resources/finish.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/resources/finish.sh b/debian/resources/finish.sh index 48d13dd..d534203 100755 --- a/debian/resources/finish.sh +++ b/debian/resources/finish.sh @@ -6,7 +6,7 @@ cd "$(dirname "$0")" #includes . ./config.sh . ./colors.sh -. ./arguments.sh +. ./environment.sh #database details database_host=127.0.0.1 From 6ca6c493d39421175ef4653dc3641d13c0517cb1 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 5 Mar 2017 21:37:56 -0700 Subject: [PATCH 56/60] Update fusionpbx.sh --- debian/resources/fusionpbx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/resources/fusionpbx.sh b/debian/resources/fusionpbx.sh index 20c2660..3d880c6 100755 --- a/debian/resources/fusionpbx.sh +++ b/debian/resources/fusionpbx.sh @@ -5,7 +5,7 @@ cd "$(dirname "$0")" . ./config.sh . ./colors.sh -. ./arguments.sh +. ./environment.sh #send a message verbose "Installing FusionPBX" From a0b8dfce665eaece7478ea2ce738a58bba406af1 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 5 Mar 2017 21:41:52 -0700 Subject: [PATCH 57/60] Update iptables.sh --- debian/resources/iptables.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/debian/resources/iptables.sh b/debian/resources/iptables.sh index b1a11c5..ff5afc0 100755 --- a/debian/resources/iptables.sh +++ b/debian/resources/iptables.sh @@ -5,7 +5,6 @@ cd "$(dirname "$0")" . ./config.sh . ./colors.sh -. ./arguments.sh #send a message verbose "Configuring IPTables" From 51d0cfc3fe80fea25ac40eb6fcfb8c63eb664912 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 5 Mar 2017 21:42:29 -0700 Subject: [PATCH 58/60] Update package-release.sh --- debian/resources/switch/package-release.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/debian/resources/switch/package-release.sh b/debian/resources/switch/package-release.sh index 33a22ba..eb63e14 100755 --- a/debian/resources/switch/package-release.sh +++ b/debian/resources/switch/package-release.sh @@ -6,7 +6,6 @@ cd "$(dirname "$0")" . ../config.sh . ../colors.sh . ../environment.sh -. ../arguments.sh apt-get update && apt-get install -y --force-yes curl memcached haveged if [ ."$cpu_architecture" = ."arm" ]; then From ee91847c50acfd8c98eb46cc368de03133709067 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 5 Mar 2017 21:43:04 -0700 Subject: [PATCH 59/60] Update php.sh --- debian/resources/php.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/debian/resources/php.sh b/debian/resources/php.sh index fa369ba..3427f80 100755 --- a/debian/resources/php.sh +++ b/debian/resources/php.sh @@ -6,7 +6,6 @@ cd "$(dirname "$0")" #includes . ./config.sh . ./colors.sh -. ./arguments.sh #send a message verbose "Configuring PHP" From 659c6da8bb21131fc488d2afcc3a6106e1aebeb4 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 5 Mar 2017 22:10:25 -0700 Subject: [PATCH 60/60] Create sngrep.sh --- debian/resources/sngrep.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 debian/resources/sngrep.sh diff --git a/debian/resources/sngrep.sh b/debian/resources/sngrep.sh new file mode 100644 index 0000000..9c9bbde --- /dev/null +++ b/debian/resources/sngrep.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +#add sngrep +if [ ."$cpu_architecture" != ."arm" ]; then + echo 'deb http://packages.irontec.com/debian jessie main' > /etc/apt/sources.list.d/sngrep.list + wget http://packages.irontec.com/public.key -q -O - | apt-key add - + apt-get update + apt-get install sngrep +fi