Zhang Huangbin avatar Zhang Huangbin committed 817e48f

Improve Gentoo support:
* Awstats now works as expected (mod_auth_mysql)
* Start postfix service to send emails during installation cleaning up

Comments (0)

Files changed (3)

iRedMail/conf/core

 install_pkg_gentoo()
 {
     ECHO_INFO "Installing package(s) with option(s) '${GENTOO_EMERGE_INSTALL_OPTIONS}': $@"
+    pkgs_total="$(echo $@ | wc -w)"
+    pkgs_counter=1
     for pkg in $@; do
         if [ X"${pkg}" != X'' ]; then
             portname="$( echo ${pkg} | tr -d '-' | tr -d '/' | tr -d '\.' )"
             status="\$status_install_port_$portname"
             if [ X"$(eval echo ${status})" != X"DONE" ]; then
-                ECHO_INFO "Installing package: ${pkg}"
+                ECHO_INFO "Installing package (${pkgs_counter} of ${pkgs_total}): ${pkg}"
                 emerge ${GENTOO_EMERGE_INSTALL_OPTIONS} ${pkg}
 
                 if [ X"$?" == X"0" ]; then
             else
                 ECHO_INFO "Skip package: ${pkg}."
             fi
+            pkgs_counter=$((pkgs_counter+1))
         fi
     done
 }

iRedMail/functions/awstats.sh

 
     elif [ X"${BACKEND}" == X"MYSQL" ]; then
         # Use mod_auth_mysql.
-        if [ X"${DISTRO}" == X"RHEL" -o X"${DISTRO}" == X"SUSE" -o X"${DISTRO}" == X"FREEBSD" ]; then
+        if [ X"${DISTRO}" == X"RHEL" \
+            -o X"${DISTRO}" == X"SUSE" \
+            -o X"${DISTRO}" == X"GENTOO" \
+            -o X"${DISTRO}" == X"FREEBSD" \
+            ]; then
             cat >> ${AWSTATS_HTTPD_CONF} <<EOF
     AuthType Basic
 
             fi
 
             # OpenSuSE & FreeBSD special.
-            if [ X"${DISTRO}" == X"SUSE" -o X"${DISTRO}" == X"FREEBSD" ]; then
+            if [ X"${DISTRO}" == X"SUSE" \
+                -o X"${DISTRO}" == X"GENTOO" \
+                -o X"${DISTRO}" == X"FREEBSD" \
+                ]; then
                 echo "AuthBasicAuthoritative Off" >> ${AWSTATS_HTTPD_CONF}
             fi
 

iRedMail/functions/cleanup.sh

     [ X"${DISTRO}" == X"FREEBSD" -o X"${DISTRO}" == X'GENTOO' ] && check_status_before_run cleanup_amavisd_preconfig
     check_status_before_run cleanup_backup_scripts
 
+    # Start Postfix to deliver emails.
+    [ X"${DISTRO}" == X'GENTOO' ] && ${DIR_RC_SCRIPTS}/postfix restart >/dev/null
+
     # Send tip file to the mail server admin and/or first mail user.
     tip_recipient="${FIRST_USER}@${FIRST_DOMAIN}"
     [ ! -z "${MAIL_ALIAS_ROOT}" -a X"${MAIL_ALIAS_ROOT}" != X"${tip_recipient}" ] && \
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.