diff --git a/bin/easyengine b/bin/easyengine index 064760ac..424f2ce6 100644 --- a/bin/easyengine +++ b/bin/easyengine @@ -135,15 +135,15 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then # Check required Packages are installed or not dpkg --get-selections | grep -v deinstall | grep nginx > /dev/null \ && dpkg --get-selections | grep -v deinstall | grep php5-fpm > /dev/null \ - && dpkg --get-selections | grep -v deinstall | grep mysql > /dev/null \ + && mysqladmin ping &> /dev/null \ && dpkg --get-selections | grep -v deinstall | grep postfix > /dev/null if [ $? -ne 0 ];then - ee_lib_error "Failed to find pre dependencies. Please install Nginx, PHP5, MySQL and Postfix using command ee stack install, exit status " 1 + ee_lib_error "Failed to find pre dependencies.\nPlease install Nginx, PHP5, MySQL and Postfix using command ee stack install, exit status " 1 fi dpkg --get-selections | grep -v deinstall | grep dovecot-core > /dev/null if [ $? -eq 0 ];then - ee_lib_error "Found installed mail server, Please remove it before installation, exit status=" 1 + ee_lib_error "Found installed Dovecot Packages server, exit status=" 1 fi # Install Dovecot diff --git a/bin/update b/bin/update index 5783a27f..c719cdda 100644 --- a/bin/update +++ b/bin/update @@ -415,11 +415,17 @@ if [[ $EE_CURRENT_VERSION < $EE_LATEST_VERSION ]]; then fi if [[ $EE_CURRENT_VERSION < 2.1.0 ]];then - if [ -f /etc/nginx/common/locations.conf ];then - cp -av /usr/share/easyengine/nginx/common/locations.conf /etc/nginx/common/locations.conf &>> $EE_UPDATE_LOG - fi if [ -f /etc/nginx/sites-available/22222 ];then + ee_port=$(grep listen /etc/nginx/sites-available/22222 | awk '{ print $2 }') cp -av /usr/share/easyengine/nginx/22222 /etc/nginx/sites-available/ &>> $EE_UPDATE_LOG + if [ "$EE_LINUX_DISTRO" == "Ubuntu" ]; then + sed -i "s/listen.*/listen $ee_port default_server ssl spdy;/" /etc/nginx/sites-available/22222 \ + || ee_lib_error "Unable to change EasyEngine admin port, exit status = " $? + elif [ "$EE_LINUX_DISTRO" == "Debian" ]; then + # Dotdeb nginx repository doesn't support spdy + sed -i "s/listen.*/listen $ee_port default_server ssl;/" /etc/nginx/sites-available/22222 \ + || ee_lib_error "Unable to change EasyEngine admin port, exit status = " $? + fi fi if [ -d /var/www/22222/htdocs/db/anemometer ];then # Download pt-query-advisor Fixed #189 @@ -431,7 +437,7 @@ if [[ $EE_CURRENT_VERSION < $EE_LATEST_VERSION ]]; then sed -i "s/# 'query_advisor'/ 'query_advisor'/" /var/www/22222/htdocs/db/anemometer/conf/config.inc.php \ || ee_lib_error "Unable to to activate pt-query-advisor plugin, exit status = " $? fi - + # Update EasyEngine current version EE_CURRENT_VERSION="2.0.1" fi diff --git a/src/lib/ee_lib_error.sh b/src/lib/ee_lib_error.sh index eabfdf04..206a9023 100644 --- a/src/lib/ee_lib_error.sh +++ b/src/lib/ee_lib_error.sh @@ -2,6 +2,6 @@ function ee_lib_error() { - echo "[ `date` ] $(tput setaf 1)$@$(tput sgr0)" | tee -ai $EE_ERROR_LOG + echo -e "[ `date` ] $(tput setaf 1)$@$(tput sgr0)" | tee -ai $EE_ERROR_LOG exit $2 } diff --git a/src/modules/stack/install/mail/ee_mod_install_dovecot.sh b/src/modules/stack/install/mail/ee_mod_install_dovecot.sh index ed49ba86..e7ce0ca8 100644 --- a/src/modules/stack/install/mail/ee_mod_install_dovecot.sh +++ b/src/modules/stack/install/mail/ee_mod_install_dovecot.sh @@ -6,7 +6,7 @@ function ee_mod_install_dovecot() ee_lib_echo "Installing Dovecot, please wait..." debconf-set-selections <<< "dovecot-core dovecot-core/create-ssl-cert boolean yes" debconf-set-selections <<< "dovecot-core dovecot-core/ssl-cert-name string $(hostname -f)" - $EE_APT_GET install dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql \ + $EE_APT_GET install dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql dovecot-sieve dovecot-managesieved \ || ee_lib_error "Unable to install Dovecot, exit status = " $? } diff --git a/src/modules/stack/install/mail/ee_mod_install_sieve.sh b/src/modules/stack/install/mail/ee_mod_install_sieve.sh deleted file mode 100644 index 5deecdbf..00000000 --- a/src/modules/stack/install/mail/ee_mod_install_sieve.sh +++ /dev/null @@ -1,9 +0,0 @@ -# Install Sieve package - -function ee_mod_install_sieve() -{ - # Install Sieve - ee_lib_echo "Installing Sieve, please wait..." - $EE_APT_GET install dovecot-sieve dovecot-managesieved \ - || ee_lib_error "Unable to install Sieve, exit status = " $? -} diff --git a/src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh b/src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh index fb733dad..f3fcc9cf 100644 --- a/src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh +++ b/src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh @@ -3,7 +3,7 @@ function ee_mod_remove_dovecot() { ee_lib_echo "$EE_SECOND Dovecot package, please wait..." - $EE_APT_GET $EE_SECOND dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql \ + $EE_APT_GET $EE_SECOND dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql dovecot-sieve dovecot-managesieved \ || ee_lib_error "Unable to $EE_SECOND Dovecot, exit status = " $? userdel -rf vmail || ee_lib_error "Unable to Remove user vmail, exit status = " $? diff --git a/src/modules/stack/remove/mail/ee_mod_remove_sieve.sh b/src/modules/stack/remove/mail/ee_mod_remove_sieve.sh deleted file mode 100644 index 0c553907..00000000 --- a/src/modules/stack/remove/mail/ee_mod_remove_sieve.sh +++ /dev/null @@ -1,10 +0,0 @@ -# Remove Sieve package - -function ee_mod_remove_sieve() -{ - ee_lib_echo "$EE_SECOND Sieve package, please wait..." - $EE_APT_GET $EE_SECOND dovecot-sieve dovecot-managesieved \ - || ee_lib_error "Unable to $EE_SECOND Sieve, exit status = " $? - - -}