Commits

Zhang Huangbin  committed 4b87d19

It now works on openSUSE-12.2 (code name Mantis), with all 3 backends
available. Tested with openSUSE 12.2 RC1.

  • Participants
  • Parent commits a1188ab

Comments (0)

Files changed (15)

File iRedMail/ChangeLog

 iRedMail-0.8.2:
+    * It now works on openSUSE-12.2 (code name Mantis), with all 3 backends
+      available. Tested with openSUSE 12.2 RC1.
     * Drop support for Ubuntu-11.10 (oneiric).
     * New columns for MySQL/PGSQL backend in table vmail.mailbox:
       isadmin, isglobaladmin, language.

File iRedMail/conf/amavisd

     export AMAVISD_TEMPDIR="${AMAVISD_MYHOME}/tmp"
 
 elif [ X"${DISTRO}" == X"SUSE" ]; then
-    # openSUSE-12.1 ships Amavisd-new-2.7.0
+    # openSUSE-12.1/12.2 ships Amavisd-new-2.7.0
     export AMAVISD_VERSION='2.7'
 
     # Override global setting: user/group.

File iRedMail/conf/global

 export PROG_NAME_LOWERCASE='iredmail'
 export PROG_VERSION='0.8.1'
 
+export DATE="$(/bin/date +%Y.%m.%d.%H.%M.%S)"
+
+# For perl and run-time locale setting.
+export LC_ALL=C
+
+# Debug mode: YES, NO.
+export _DEBUG="${_DEBUG:=NO}"
+
 # -----------------
 # ---- Generic ----
 # -----------------
 export ENABLE_BACKEND_MYSQL='YES'
 export ENABLE_BACKEND_PGSQL='NO'
 
+# Enabled components.
+export DIALOG_SELECTABLE_AWSTATS='YES'
+
 # For better distributed deployment
 # IP address of localhost. usually it's 127.0.0.1, but not in FreeBSD Jail.
 export LOCAL_ADDRESS='127.0.0.1'
 # Default virtual domain admin name without domain name (@example.com).
 export DOMAIN_ADMIN_NAME='postmaster'
 
-# ----------------------------------
-# You do *NOT* need to modify them.
-# ----------------------------------
-export DATE="$(/bin/date +%Y.%m.%d.%H.%M.%S)"
-
-# For perl and run-time locale setting.
-export LC_ALL=C
-
-# Debug mode: YES, NO.
-if [ X"${_DEBUG}" != X'YES' ]; then
-    export _DEBUG='NO'
-fi
-
 # Tools.
 export CONFIG_VIA_DIALOG="${DIALOG_DIR}/config_via_dialog.sh"
 # Note: config file will be sourced in file 'conf/core', function 'check_env()'.
 
         # code name
         #   - 12.1: asparagus
+        #   - 12.2: mantis
         export DISTRO_CODENAME="$(grep 'CODENAME' /etc/SuSE-release | awk '{print $3}' |tr [A-Z] [a-z])"
 
         # Unsupported releases
             export UNSUPPORTED_RELEASE='YES'
         fi
 
+        if [ X"${DISTRO_CODENAME}" == X'mantis' ]; then
+            export ENABLE_BACKEND_PGSQL='YES'
+        fi
     elif [ -f /etc/lsb-release ]; then
         # Ubuntu
         export DISTRO='UBUNTU'

File iRedMail/conf/phpmyadmin

 export PHPMYADMIN_HTTPD_ROOT_SYMBOL_LINK="${HTTPD_SERVERROOT}/phpmyadmin"
 
 # Install phpMyAdmin with binary packages.
-if [ X"${DISTRO}" == X'DEBIAN' -o X"${DISTRO}" == X'UBUNTU' ]; then
+if [ X"${DISTRO}" == X'SUSE' ]; then
+    if [ X"${DISTRO_CODENAME}" == X'mantis' ]; then
+        export PHPMYADMIN_USE_SOURCE='NO'
+        export PHPMYADMIN_HTTPD_ROOT="${HTTPD_DOCUMENTROOT}/phpMyAdmin"
+        export PHPMYADMIN_HTTPD_ROOT_SYMBOL_LINK="${PHPMYADMIN_HTTPD_ROOT}"
+    fi
+elif [ X"${DISTRO}" == X'DEBIAN' -o X"${DISTRO}" == X'UBUNTU' ]; then
     export PHPMYADMIN_USE_SOURCE='NO'
     export PHPMYADMIN_HTTPD_ROOT="/usr/share/phpmyadmin"
     export PHPMYADMIN_HTTPD_ROOT_SYMBOL_LINK="${PHPMYADMIN_HTTPD_ROOT}"

File iRedMail/conf/phppgadmin

 export PHPPGADMIN_HTTPD_CONF="${HTTPD_CONF_DIR}/phppgadmin.conf"
 
 # Install phpPgAdmin with binary packages.
-if [ X"${DISTRO}" == X'DEBIAN' -o X"${DISTRO}" == X'UBUNTU' ]; then
+if [ X"${DISTRO}" == X'SUSE' ]; then
+    if [ X"${DISTRO_CODENAME}" == X'mantis' ]; then
+        export PHPPGADMIN_USE_SOURCE='NO'
+        export PHPPGADMIN_HTTPD_ROOT="${HTTPD_DOCUMENTROOT}/phpPgAdmin"
+        export PHPPGADMIN_HTTPD_ROOT_SYMBOL_LINK="${PHPMYADMIN_HTTPD_ROOT}"
+        export PHPPGADMIN_HTTPD_CONF="${HTTPD_CONF_DIR}/phppgadmin"
+    fi
+elif [ X"${DISTRO}" == X'DEBIAN' -o X"${DISTRO}" == X'UBUNTU' ]; then
     export PHPPGADMIN_USE_SOURCE='NO'
     export PHPPGADMIN_HTTPD_ROOT="/usr/share/phppgadmin"
     export PHPPGADMIN_HTTPD_ROOT_SYMBOL_LINK="${PHPPGADMIN_HTTPD_ROOT}"
     export PHPPGADMIN_HTTPD_CONF="${HTTPD_CONF_DIR}/phppgadmin.conf"
 fi
 
-export PHPPGADMIN_CONFIG_FILE="${PHPPGADMIN_HTTPD_ROOT}/conf/config.inc.php"
+if [ X"${DISTRO}" == X'SUSE' ]; then
+    export PHPPGADMIN_CONFIG_FILE="/etc/phpPgAdmin/config.inc.php"
+else
+    export PHPPGADMIN_CONFIG_FILE="${PHPPGADMIN_HTTPD_ROOT}/conf/config.inc.php"
+fi

File iRedMail/conf/postgresql

     export PGSQL_CONF_PG_HBA="${PGSQL_DATA_DIR}/pg_hba.conf"
 
 elif [ X"${DISTRO}" == X'SUSE' ]; then
-    :
+    export PGSQL_SYS_USER_HOME='/var/lib/pgsql'
+    export PGSQL_DATA_DIR="${PGSQL_SYS_USER_HOME}/data"
+
+    export PGSQL_CONF_DIR="${PGSQL_DATA_DIR}"
+    export PGSQL_CONF_POSTGRESQL="${PGSQL_DATA_DIR}/postgresql.conf"
+    export PGSQL_CONF_PG_HBA="${PGSQL_DATA_DIR}/pg_hba.conf"
 
 elif [ X"${DISTRO}" == X'GENTOO' ]; then
     export PGSQL_CONF_DIR="/etc/postgresql-${PGSQL_VERSION}"

File iRedMail/dialog/optional_components.sh

 # ----------------------------------------
 # Optional components for special backend.
 # ----------------------------------------
+# Detect selectable menu items
+if [ X"${DISTRO}" == X'SUSE' ]; then
+    # Apache module mod_auth_pgsql is not available
+    if [ X"${DISTRO_CODENAME}" == X'mantis' ]; then
+        [ X"${BACKEND}" == X'PGSQL' ] && export DIALOG_SELECTABLE_AWSTATS='NO'
+    fi
+elif [ X"${DISTRO}" == X'OPENBSD' ]; then
+    # Binary/port Awstats is not available
+    export DIALOG_SELECTABLE_AWSTATS='NO'
+fi
+
+# Construct dialog menu list
+# Format: item_name item_descrition on/off
+# Note: item_descrition must be concatenated by '_'.
+export LIST_OF_OPTIONAL_COMPONENTS=''
+
+if [ X"${DIALOG_SELECTABLE_AWSTATS}" == X'YES' ]; then
+    LIST_OF_OPTIONAL_COMPONENTS="${LIST_OF_OPTIONAL_COMPONENTS} Awstats Advanced_web_and_mail_log_analyzer on"
+fi
+
 export tmp_config_optional_components="${ROOTDIR}/.optional_components"
 
 if [ X"${BACKEND}" == X"OPENLDAP" ]; then
     "Roundcubemail" "WebMail program (PHP, AJAX)" "on" \
     "phpLDAPadmin" "Web-based OpenLDAP management tool" "on" \
     "phpMyAdmin" "Web-based MySQL management tool" "on" \
-    "Awstats" "Advanced web and mail log analyzer" "on" \
+    ${LIST_OF_OPTIONAL_COMPONENTS} \
     "Fail2ban" "Ban IP with too many password failures" "on" \
     2>${tmp_config_optional_components}
 
     "Roundcubemail" "WebMail program (PHP, AJAX)" "on" \
     "phpMyAdmin" "Web-based MySQL management tool" "on" \
     "iRedAdmin" "Official web-based Admin Panel" "on" \
-    "Awstats" "Advanced web and mail log analyzer" "on" \
+    ${LIST_OF_OPTIONAL_COMPONENTS} \
     "Fail2ban" "Ban IP with too many password failures" "on" \
     2>${tmp_config_optional_components}
+
 elif [ X"${BACKEND}" == X"PGSQL" ]; then
     ${DIALOG} \
     --title "Optional Components for ${BACKEND_ORIG} backend" \
     "Roundcubemail" "WebMail program (PHP, AJAX)" "on" \
     "iRedAdmin" "Official web-based Admin Panel" "on" \
     "phpPgAdmin" "Web-based MySQL management tool" "on" \
-    "Awstats" "Advanced web and mail log analyzer" "on" \
+    ${LIST_OF_OPTIONAL_COMPONENTS} \
     "Fail2ban" "Ban IP with too many password failures" "on" \
     2>${tmp_config_optional_components}
 fi

File iRedMail/functions/awstats.sh

     AuthBasicProvider ldap
     AuthzLDAPAuthoritative   Off
 
-    AuthLDAPUrl   ldap://${LDAP_SERVER_HOST}:${LDAP_SERVER_PORT}/${LDAP_ADMIN_BASEDN}?${LDAP_ATTR_USER_RDN}?sub?(&(objectclass=${LDAP_OBJECTCLASS_MAILADMIN})(${LDAP_ATTR_ACCOUNT_STATUS}=${LDAP_STATUS_ACTIVE}))
+    AuthLDAPUrl   ldap://${LDAP_SERVER_HOST}:${LDAP_SERVER_PORT}/${LDAP_BASEDN}?${LDAP_ATTR_USER_RDN}?sub?(&(objectclass=${LDAP_OBJECTCLASS_MAILUSER})(${LDAP_ATTR_ACCOUNT_STATUS}=${LDAP_STATUS_ACTIVE})(${LDAP_ENABLED_SERVICE}=${LDAP_SERVICE_DOMAIN_ADMIN})(${LDAP_ATTR_DOMAIN_GLOBALADMIN}=${LDAP_VALUE_DOMAIN_GLOBALADMIN}))
 
     AuthLDAPBindDN "${LDAP_BINDDN}"
     AuthLDAPBindPassword "${LDAP_BINDPW}"
     AuthMySQLUserTable admin
     AuthMySQLNameField username
     AuthMySQLPasswordField password
+    AuthMySQLUserCondition "isadmin=1 AND isglobaladmin=1"
 EOF
 
             # FreeBSD special.
                 -o X"${DISTRO}" == X"GENTOO" \
                 -o X"${DISTRO}" == X"FREEBSD" \
                 ]; then
-                echo "AuthBasicAuthoritative Off" >> ${AWSTATS_HTTPD_CONF}
+                echo "    AuthBasicAuthoritative Off" >> ${AWSTATS_HTTPD_CONF}
             fi
 
+
         elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
             cat >> ${AWSTATS_HTTPD_CONF} <<EOF
     AuthType Basic

File iRedMail/functions/cluebringer.sh

     #   - Ubuntu
     #   - openSUSE
     #   - Gentoo
-    if [ X"${DISTRO}" == X'RHEL' ]; then
+    if [ X"${DISTRO}" == X'RHEL' -o X"${DISTRO}" == X'SUSE' ]; then
         groupadd ${CLUEBRINGER_GROUP}
         useradd -m -d ${CLUEBRINGER_USER_HOME} -s ${SHELL_NOLOGIN} -g ${CLUEBRINGER_GROUP} ${CLUEBRINGER_USER}
     elif [ X"${DISTRO}" == X'FREEBSD' ]; then

File iRedMail/functions/optional_components.sh

 # -------------------------------------------
 optional_components()
 {
+    # iRedAPD.
+    [ X"${USE_IREDAPD}" == X'YES' ] && \
+        check_status_before_run iredapd_config
+
+    # iRedAdmin.
+    [ X"${USE_IREDADMIN}" == X"YES" ] && \
+        check_status_before_run iredadmin_config
+
+    # Fail2ban.
+    [ X"${USE_FAIL2BAN}" == X'YES' \
+        -a X"${DISTRO}" != X'FREEBSD' \
+        -a X"${DISTRO}" != X'OPENBSD' \
+        ] && \
+        check_status_before_run fail2ban_config
+
+    # Awstats.
+    [ X"${USE_AWSTATS}" == X"YES" ] && \
+        check_status_before_run awstats_config_basic && \
+        check_status_before_run awstats_config_weblog && \
+        check_status_before_run awstats_config_maillog && \
+        check_status_before_run awstats_config_crontab
+
     # Roundcubemail.
     [ X"${USE_RCM}" == X"YES" ] && \
         check_status_before_run rcm_install && \
     [ X"${USE_PHPPGADMIN}" == X"YES" ] && \
         check_status_before_run phppgadmin_install
 
-    # Awstats.
-    if [ X"${DISTRO}" != X'OPENBSD' ]; then
-        [ X"${USE_AWSTATS}" == X"YES" ] && \
-            check_status_before_run awstats_config_basic && \
-            check_status_before_run awstats_config_weblog && \
-            check_status_before_run awstats_config_maillog && \
-            check_status_before_run awstats_config_crontab
-    fi
-
-    # iRedAdmin.
-    [ X"${USE_IREDADMIN}" == X"YES" ] && \
-        check_status_before_run iredadmin_config
-
-    # iRedAPD.
-    [ X"${USE_IREDAPD}" == X'YES' ] && \
-        check_status_before_run iredapd_config
-
-    # Fail2ban.
-    [ X"${USE_FAIL2BAN}" == X'YES' \
-        -a X"${DISTRO}" != X'FREEBSD' \
-        -a X"${DISTRO}" != X'OPENBSD' \
-        ] && \
-        check_status_before_run fail2ban_config
 
 }

File iRedMail/functions/packages.sh

     ###########################
     # Enable syslog or rsyslog.
     #
-    if [ X"${DISTRO}" == X"RHEL" ]; then
-        # RHEL/CENTOS, openSUSE
+    if [ X"${DISTRO}" == X'RHEL' ]; then
+        # RHEL/CENTOS/Scientific
         if [ -x ${DIR_RC_SCRIPTS}/syslog ]; then
             ENABLED_SERVICES="syslog ${ENABLED_SERVICES}"
         elif [ -x ${DIR_RC_SCRIPTS}/rsyslog ]; then
         fi
 
     elif [ X"${DISTRO}" == X"SUSE" ]; then
-        ALL_PKGS="${ALL_PKGS} apache2-prefork apache2-mod_php5 php5-iconv php5-ldap php5-mysql php5-mcrypt php5-mbstring php5-gettext php5-dom php5-json php5-intl php5-fileinfo"
+        # Apache
+        ALL_PKGS="${ALL_PKGS} apache2-prefork apache2-mod_php5"
+
+        # PHP
+        ALL_PKGS="${ALL_PKGS} php5-dom php5-fileinfo php5-gettext php5-iconv php5-intl php5-json php5-ldap php5-mbstring php5-mcrypt"
+
+        [ X"${BACKEND}" == X'OPENLDAP' -o X"${BACKEND}" == X'MYSQL' ] && ALL_PKGS="${ALL_PKGS} php5-mysql"
+        [ X"${BACKEND}" == X'PGSQL' ] && ALL_PKGS="${ALL_PKGS} php5-pgsql"
 
     elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
         ALL_PKGS="${ALL_PKGS} apache2 apache2-mpm-prefork apache2.2-common libapache2-mod-php5 php5-cli php5-imap php5-gd php5-mcrypt php5-mysql php5-ldap php5-pgsql"
         DISABLED_SERVICES="${DISABLED_SERVICES} saslauthd"
 
     elif [ X"${DISTRO}" == X"SUSE" ]; then
-        ALL_PKGS="${ALL_PKGS} dovecot20"
+        [ X"${DISTRO_CODENAME}" == X'asparagus' ] && ALL_PKGS="${ALL_PKGS} dovecot20"
+        [ X"${DISTRO_CODENAME}" == X'mantis' ] && ALL_PKGS="${ALL_PKGS} dovecot21"
 
         if [ X"${BACKEND}" == X"MYSQL" ]; then
-            ALL_PKGS="${ALL_PKGS} dovecot20-backend-mysql"
+            [ X"${DISTRO_CODENAME}" == X'asparagus' ] && ALL_PKGS="${ALL_PKGS} dovecot20-backend-mysql"
+            [ X"${DISTRO_CODENAME}" == X'mantis' ] && ALL_PKGS="${ALL_PKGS} dovecot21-backend-mysql"
         elif [ X"${BACKEND}" == X"PGSQL" ]; then
-            ALL_PKGS="${ALL_PKGS} dovecot20-backend-pgsql"
+            [ X"${DISTRO_CODENAME}" == X'asparagus' ] && ALL_PKGS="${ALL_PKGS} dovecot20-backend-pgsql"
+            [ X"${DISTRO_CODENAME}" == X'mantis' ] && ALL_PKGS="${ALL_PKGS} dovecot21-backend-pgsql"
         fi
 
     elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
         DISABLED_SERVICES="${DISABLED_SERVICES} spamassassin"
 
     elif [ X"${DISTRO}" == X"SUSE" ]; then
-        ALL_PKGS="${ALL_PKGS} perl-Mail-SPF amavisd-new clamav clamav-db spamassassin altermime perl-ldap perl-DBD-mysql"
+        ALL_PKGS="${ALL_PKGS} perl-Mail-SPF amavisd-new clamav clamav-db spamassassin altermime"
+
+        [ X"${BACKEND}" == X'OPENLDAP' ] && ALL_PKGS="${ALL_PKGS} perl-ldap perl-DBD-mysql"
+        [ X"${BACKEND}" == X'MYSQL' ] && ALL_PKGS="${ALL_PKGS} perl-DBD-mysql"
+        [ X"${BACKEND}" == X'PGSQL' ] && ALL_PKGS="${ALL_PKGS} perl-DBD-Pg"
+
         ENABLED_SERVICES="${ENABLED_SERVICES} ${CLAMAV_FRESHCLAMD_RC_SCRIPT_NAME}"
         DISABLED_SERVICES="${DISABLED_SERVICES} clamav-milter spamd spampd"
 
 
     # phpMyAdmin
     if [ X"${USE_PHPMYADMIN}" == X"YES" ]; then
-        if [ X"${DISTRO}" == X'DEBIAN' -o X"${DISTRO}" == X'UBUNTU' ]; then
+        if [ X"${DISTRO}" == X'SUSE' ]; then
+            ALL_PKGS="${ALL_PKGS} phpMyAdmin"
+        elif [ X"${DISTRO}" == X'DEBIAN' -o X"${DISTRO}" == X'UBUNTU' ]; then
             ALL_PKGS="${ALL_PKGS} phpmyadmin"
         elif [ X"${DISTRO}" == X'OPENBSD' ]; then
             ALL_PKGS="${ALL_PKGS} phpMyAdmin"
     elif [ X"${DISTRO}" == X"SUSE" ]; then
         ALL_PKGS="${ALL_PKGS} apache2-mod_wsgi python-jinja2 python-mysql python-xml"
 
-        # Note: Web.py will be installed locally with command 'easy_install'.
-        ALL_PKGS="${ALL_PKGS} python-distribute"
+        # openSUSE-12.1: Web.py will be installed locally with command 'easy_install'.
+        [ X"${DISTRO_CODENAME}" == X'asparagus' ] && ALL_PKGS="${ALL_PKGS} python-distribute"
+        [ X"${DISTRO_CODENAME}" == X'mantis' ] && ALL_PKGS="${ALL_PKGS} python-web.py"
 
     elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
         ALL_PKGS="${ALL_PKGS} libapache2-mod-wsgi python-mysqldb python-jinja2 python-netifaces python-webpy"
     # Install all packages.
     install_all_pkgs()
     {
-        if [ X"${DISTRO}" == X"SUSE" ]; then
+        if [ X"${DISTRO}" == X'SUSE' ]; then
             rpm -e patterns-openSUSE-minimal_base-conflicts &>/dev/null
+            rpm -e exim &>/dev/null
         fi
 
         # Install all packages.
         fi
         eval ${install_pkg} ${ALL_PKGS}
 
-        if [ X"${DISTRO}" == X"SUSE" -a X"${USE_IREDADMIN}" == X"YES" ]; then
+        if [ X"${DISTRO}" == X"SUSE" \
+            -a X"${USE_IREDADMIN}" == X'YES' \
+            -a X"${DISTRO_CODENAME}" == X'asparagus' \
+            ]; then
             ECHO_DEBUG "Install web.py (${MISC_DIR}/web.py-*.tar.bz)."
             easy_install ${MISC_DIR}/web.py-*.tar.gz >/dev/null
         fi

File iRedMail/functions/phpmyadmin.sh

     fi
 
     ECHO_DEBUG "Create directory alias for phpMyAdmin in Apache: ${HTTPD_CONF_DIR}/phpmyadmin.conf."
-    cat > ${HTTPD_CONF_DIR}/phpmyadmin.conf <<EOF
+    if [ X"${DISTRO_CODENAME}" != X'mantis' ]; then
+        cat > ${HTTPD_CONF_DIR}/phpmyadmin.conf <<EOF
 ${CONF_MSG}
 # Note: Please refer to ${HTTPD_SSL_CONF} for SSL/TLS setting.
 <Directory "${PHPMYADMIN_HTTPD_ROOT_SYMBOL_LINK}/">
     Options -Indexes
 </Directory>
 EOF
+    fi
 
     # Make phpMyAdmin can be accessed via HTTPS only.
     perl -pi -e 's#^(</VirtualHost>)#Alias /phpmyadmin "$ENV{PHPMYADMIN_HTTPD_ROOT_SYMBOL_LINK}/"\n${1}#' ${HTTPD_SSL_CONF}

File iRedMail/functions/policyd.sh

     perl -pi -e 's#^(GID=)(.*)#${1}$ENV{policyd_group_id}#' ${POLICYD_THROTTLE_CONF}
 
     # ---- RECIPIENT THROTTLE ----
-    perl -pi -e 's#^(RECIPIENTTHROTTLE=)(.*)#${1}0#' ${POLICYD_THROTTLE_CONF}
+    perl -pi -e 's#^(RECIPIENTTHROTTLE=)(.*)#${1}1#' ${POLICYD_THROTTLE_CONF}
 
     # ------------------ DISABLE ALL OTHER FEATURES -----------------
     # ---- WHITELISTING ----

File iRedMail/functions/postgresql.sh

 
     if [ X"${DISTRO}" == X'RHEL' ]; then
         ${PGSQL_RC_SCRIPT} initdb &>/dev/null
+    elif [ X"${DISTRO}" == X'SUSE' ]; then
+        su - ${PGSQL_SYS_USER} -c "initdb -D ${PGSQL_DATA_DIR} -U ${PGSQL_SYS_USER} -A trust" >/dev/null
     fi
 
     backup_file ${PGSQL_CONF_PG_HBA} ${PGSQL_CONF_POSTGRESQL}

File iRedMail/pkgs/get_all.sh

 autorefresh=1
 path=/
 type=rpm-md
-keeppackages=0
+keeppackages=1
 gpgcheck=0
 EOF
 
 elif [ X"${DISTRO}" == X"SUSE" ]; then
     create_repo_suse
 
-    ECHO_INFO "Clean and refresh metadata of zypper repositories."
+    ECHO_INFO "Clean metadata of zypper repositories."
     zypper clean --metadata --raw-metadata
+
+    ECHO_INFO "Refresh zypper repositories."
     zypper refresh
 elif [ X"${DISTRO}" == X'DEBIAN' -o X"${DISTRO}" == X'UBUNTU' ]; then
     # Force update.