#!/bin/bash . /usr/src/mor/framework/bash_functions.sh . /usr/src/mor/framework/framework.conf . /usr/src/mor/framework/mor_install_functions.sh . /usr/src/mor/framework/settings.sh exec > >(tee -a install.log) exec 2> >(tee -a install.log >&2) echo "Starting MOR X9 installation..." echo `date` src="/usr/src/mor/x9" skip() { echo } # check for rvm presence to detemrine if server is empty or not if [ -f '/usr/local/rvm/bin/rvm' ]; then . /usr/src/mor/framework/bash_functions.sh report "System is not empty, aborting installation" 6 exit 0 fi # moving this to beginning, so engineers installing system won't need to wait # before selecting configuration options # If FREE option is added, standard configuration file is used # without any asking (not to confuse clients, who install themselves) $src/maintenance/configuration_prepare.sh "$@" # system update #yum -y update # need reboot after that # checking if apache user exist. Related TRAC #10975 grep apache /etc/passwd &>/dev/null if [ "$?" == "0" ]; then grep apache /etc/passwd | grep 1000 &>/dev/null if [ "$?" == "0" ]; then echo "Apache user already exist with incorrect UID. Please report to TRAC #10975" else echo "Apache user already exist. This is not minimal clean Centos install" fi echo "Press any key to Continue or CRTL+C to Cancel" read user_input; fi # for DB/GUI/CORE servers # environment check $src/maintenance/vm_detection.sh $src/maintenance/dns_check.sh # todo: we should terminate if dns does not work # environment preparation $src/maintenance/time_sync.sh echo `date` # after sync we will get better time $src/maintenance/selinux_disable.sh $src/maintenance/yum_updatesd_disable.sh $src/maintenance/iptables_clean.sh $src/maintenance/time_sync.sh $src/maintenance/ssl_fix_heartbleed.sh $src/maintenance/folders_permissions_prepare.sh $src/maintenance/remove_tmpwatch_cron.sh #$src/maintenance/aliases_install.sh $src/maintenance/packets_install.sh # necessary for DB/GUI servers $src/gui/rvm_install.sh $src/gui/ruby_install.sh # for DB server $src/mysql/mysql_install.sh $src/db/db_create.sh NEW $src/db/init_archived_calls.sh $src/db/disable_mysql_secure_file_priv.sh INSTALL # for GUI server $src/gui/apache_install.sh $src/gui/gui_install.sh $src/gui/xsendfile_install.sh $src/gui/passenger_install.sh $src/gui/memcached_install.sh $src/gui/invoice_template_install.sh $src/mysql/phpmyadmin_install.sh # disabling for now CRM 35018 #$src/gui/certificates_for_authorized_install.sh # Install ES on main GUI server read_mor_gui_settings if [ "$MAIN_GUI" == "1" ]; then /usr/src/mor/sh_scripts/elasticsearch/elasticsearch_install.sh fi #enable addons for free version if [ "$1" = "FREE" ] || [ "$1" = "Free" ] || [ "$1" = "free" ]; then $src/gui/enable_addons.sh fi #some scripts needs to use right version of ruby. Those will use following symlink which point to ruby-2.1.2@global ln -s $src/gui/misc/mor_ruby /usr/local/mor/mor_ruby chmod +x /usr/local/mor/mor_ruby # Asterisk $src/asterisk/asterisk_install.sh $src/asterisk/asterisk_logger_config.sh $src/asterisk/freeze_check/freeze_check_install.sh #Need updated version $src/core/core_install_10cc.sh # Helper packages $src/helpers/lame_install.sh $src/helpers/elunia_stats_install.sh $src/helpers/fail2ban_install.sh $src/helpers/iperf_install.sh $src/helpers/phpsysinfo_install.sh $src/helpers/mor_ip_whitelist/install_mor_ip_whitelist.sh $src/helpers/mor_gui_iptables/mor_gui_iptables_install.sh $src/helpers/smpp_install.sh $src/helpers/whatmask_install.sh $src/helpers/mor_blocked_countries/mor_blocked_countries_install.sh # Scripts $src/scripts/scripts_install.sh cp -f $src/scripts/backups/make_restore.sh /usr/local/mor/ cp -f $src/scripts/backups/make_backup.sh /usr/local/mor/ read_mor_pcap_settings if [ $PCAP_ENABLED != "0" ]; then $src/helpers/mor_pcap_control/install_mor_pcap_control.sh $src/helpers/mor_pcap_control/install_mor_pcap_check_space.sh fi # Final touches $src/maintenance/logrotates_enable.sh $src/maintenance/permissions_post_install.sh $src/maintenance/alias_activate.sh $src/db/generate_uniquehash.sh # disable iax2, h323 and g723 (if not used) $src/asterisk/disable_iax2.sh $src/asterisk/disable_h323.sh $src/asterisk/disable_g723.sh # fix safe_asterisk script /usr/src/mor/sh_scripts/asterisk/safe_asterisk_fix.sh mkdir -p /tmp/mor/invoices chmod 777 -R /tmp/mor/invoices # major check/fix $src/info.sh echo `date`