Zhang Huangbin avatar Zhang Huangbin committed cef9bd2

Code cleanup: use upper case for value of $BACKEND.

Comments (0)

Files changed (19)

iRedMail/conf/mysql

 export SAMPLE_SQL="${SAMPLE_DIR}/iredmail.sql"
 
 export BACKUP_DATABASES="${BACKUP_DATABASES} mysql"
-if [ X"${BACKEND}" == X"MySQL" ]; then
+if [ X"${BACKEND}" == X"MYSQL" ]; then
     export BACKUP_DATABASES="${BACKUP_DATABASES} ${VMAIL_DB}"
 fi

iRedMail/conf/postfix

 export mysql_recipient_bcc_maps_user_cf="${POSTFIX_LOOKUP_DIR_MYSQL}/recipient_bcc_maps_user.cf"
 export mysql_relay_domains_cf="${POSTFIX_LOOKUP_DIR_MYSQL}/relay_domains.cf"
 
-if [ X"${BACKEND}" == X"OpenLDAP" ]; then
+if [ X"${BACKEND}" == X"OPENLDAP" ]; then
     export POSTFIX_LOOKUP_DIR="${POSTFIX_LOOKUP_DIR_LDAP}"
-elif [ X"${BACKEND}" == X"MySQL" ]; then
+elif [ X"${BACKEND}" == X"MYSQL" ]; then
     export POSTFIX_LOOKUP_DIR="${POSTFIX_LOOKUP_DIR_MYSQL}"
 else
     export POSTFIX_LOOKUP_DIR="${POSTFIX_ROOTDIR}/lookups"

iRedMail/dialog/awstats_config.sh

 
 . ${CONF_DIR}/awstats
 
-if [ X"${BACKEND}" == X"OpenLDAP" -o X"${BACKEND}" == X"MySQL" ]; then
+if [ X"${BACKEND}" == X"OPENLDAP" -o X"${BACKEND}" == X"MYSQL" ]; then
     :
 else
     # Set username for awstats access.

iRedMail/dialog/config_via_dialog.sh

     --radiolist "\
 We provide two backends and the homologous webmail programs:
 
-    +----------+---------------+---------------------------+
-    | Backend  | Web Mail      | Web-based management tool |
-    +----------+---------------+---------------------------+
-    | OpenLDAP |               | iRedAdmin, phpLDAPadmin   |
-    +----------+   Roundcube   +---------------------------+
-    | MySQL    |               | iRedAdmin, phpMyAdmin     |
-    +----------+---------------+---------------------------+
+    +------------+---------------+---------------------------+
+    | Backend    | Web Mail      | Web-based management tool |
+    +------------+---------------+---------------------------+
+    | OpenLDAP   |               | iRedAdmin, phpLDAPadmin   |
+    +------------+               +---------------------------+
+    | MySQL      | Roundcube     | iRedAdmin, phpMyAdmin     |
+    +------------+               +---------------------------+
+    | PostgreSQL |               | phpPGadmin                |
+    +------------+---------------+---------------------------+
 
 TIP:
-    * Use 'Space' key to select item.
+    * Use SPACE key to select item.
 
-" 20 76 2 \
-    "OpenLDAP" "An open source implementation of LDAP protocol. " "on" \
-    "MySQL" "The world's most popular open source database." "off" \
+" 20 76 3 \
+    'OpenLDAP' 'An open source implementation of LDAP protocol' 'on' \
+    'MySQL' "The world's most popular open source database" 'off' \
+    'PostgreSQL' 'powerful, open source object-relational database system' 'off' \
     2>/tmp/backend
 
-BACKEND="$(cat /tmp/backend)"
+BACKEND_ORIG="$(cat /tmp/backend)"
+if [ X"${BACKEND_ORIG}" == X'OpenLDAP' ]; then
+    export BACKEND='OPENLDAP'
+elif [ X"${BACKEND_ORIG}" == X'MySQL' ]; then
+    export BACKEND='MYSQL'
+elif [ X"${BACKEND_ORIG}" == X'PostgreSQL' ]; then
+    export BACKEND='PGSQL'
+fi
 echo "export BACKEND='${BACKEND}'" >> ${CONFIG_FILE}
 rm -f /tmp/backend
 
 echo "export RCM_DB_USER='${RCM_DB_USER}'" >> ${CONFIG_FILE}
 echo "export RCM_DB_PASSWD='${RCM_DB_PASSWD}'" >> ${CONFIG_FILE}
 
-if [ X"${BACKEND}" == X"OpenLDAP" ]; then
+if [ X"${BACKEND}" == X"OPENLDAP" ]; then
     . ${DIALOG_DIR}/ldap_config.sh
 else
     :

iRedMail/dialog/optional_components.sh

 # ----------------------------------------
 export tmp_config_optional_components="${ROOTDIR}/.optional_components"
 
-if [ X"${BACKEND}" == X"OpenLDAP" ]; then
+if [ X"${BACKEND}" == X"OPENLDAP" ]; then
     ${DIALOG} \
-    --title "Optional Components for ${BACKEND} backend" \
+    --title "Optional Components for ${BACKEND_ORIG} backend" \
     --checklist "\
 Note:
     * DKIM is recommended.
     "Fail2ban" "Ban IP with too many password failures" "on" \
     2>${tmp_config_optional_components}
 
-elif [ X"${BACKEND}" == X"MySQL" ]; then
+elif [ X"${BACKEND}" == X"MYSQL" ]; then
     ${DIALOG} \
-    --title "Optional Components for ${BACKEND} backend" \
+    --title "Optional Components for ${BACKEND_ORIG} backend" \
     --checklist "\
 Note:
     * DKIM is recommended.

iRedMail/functions/amavisd.sh

     echo -e '\n----' > ${DISCLAIMER_DIR}/default.txt
 
     # Integrate LDAP.
-    if [ X"${BACKEND}" == X"OpenLDAP" ]; then
+    if [ X"${BACKEND}" == X"OPENLDAP" ]; then
         cat >> ${AMAVISD_CONF} <<EOF
 # Integrate Amavisd-new with OpenLDAP.
 \$enable_ldap    = 1;    # 1 -> enable, 0 -> disable.
 EOF
 
     # Lookup agains MySQL, for MySQL backend only.
-    if [ X"${BACKEND}" == X"MySQL" ]; then
+    if [ X"${BACKEND}" == X"MYSQL" ]; then
         cat >> ${AMAVISD_CONF} <<EOF
 # Uncomment below two lines to lookup virtual mail domains from MySQL database.
 #@lookup_sql_dsn =  (
 # WARNING: IN() may cause MySQL lookup performance issue.
 #\$sql_select_policy = "SELECT domain FROM domain WHERE CONCAT('@', domain) IN (%k)";
 EOF
-    elif [ X"${BACKEND}" == X"OpenLDAP" ]; then
+    elif [ X"${BACKEND}" == X"OPENLDAP" ]; then
         cat >> ${AMAVISD_CONF} <<EOF
 #@lookup_sql_dsn = @storage_sql_dsn;
 EOF

iRedMail/functions/apache_php.sh

         a2enmod ssl >/dev/null
         a2enmod deflate >/dev/null 2>&1
 
-        [ X"${BACKEND}" == X"OpenLDAP" ] && a2enmod authnz_ldap > /dev/null
-        [ X"${BACKEND}" == X"MySQL" ] && a2enmod auth_mysql > /dev/null
+        [ X"${BACKEND}" == X"OPENLDAP" ] && a2enmod authnz_ldap > /dev/null
+        [ X"${BACKEND}" == X"MYSQL" ] && a2enmod auth_mysql > /dev/null
 
         # Ubuntu 10.04.
         # Comments starting with '#' are deprecated.
         a2enmod ssl &>/dev/null
         perl -pi -e 's/#(Listen 443)/${1}/' ${HTTPD_CONF_ROOT}/listen.conf
 
-        [ X"${BACKEND}" == X"OpenLDAP" ] && \
+        [ X"${BACKEND}" == X"OPENLDAP" ] && \
             a2enmod authnz_ldap &>/dev/null && \
             a2enmod ldap &>/dev/null
 
-        [ X"${BACKEND}" == X"MySQL" ] && a2enmod auth_mysql &>/dev/null
+        [ X"${BACKEND}" == X"MYSQL" ] && a2enmod auth_mysql &>/dev/null
     else
         :
     fi

iRedMail/functions/awstats.sh

 EOF
 
     ECHO_DEBUG "Setup user auth for awstats: ${AWSTATS_HTTPD_CONF}."
-    if [ X"${BACKEND}" == X"OpenLDAP" ]; then
+    if [ X"${BACKEND}" == X"OPENLDAP" ]; then
         # Use LDAP auth.
         cat >> ${AWSTATS_HTTPD_CONF} <<EOF
     AuthType Basic
         [ X"${LDAP_USE_TLS}" == X"YES" ] && \
             perl -pi -e 's#(AuthLDAPUrl.*)(ldap://)(.*)#${1}ldaps://${3}#' ${AWSTATS_HTTPD_CONF}
 
-    elif [ X"${BACKEND}" == X"MySQL" ]; then
+    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
             cat >> ${AWSTATS_HTTPD_CONF} <<EOF

iRedMail/functions/backend.sh

 # -------------------------------------------------------
 backend_install()
 {
-    if [ X"${BACKEND}" == X"OpenLDAP" ]; then
+    if [ X"${BACKEND}" == X"OPENLDAP" ]; then
         # Install, config and initialize OpenLDAP.
         check_status_before_run openldap_config && \
         check_status_before_run openldap_data_initialize
 
         # Initialize MySQL database server.
         check_status_before_run mysql_initialize
-    elif [ X"${BACKEND}" == X"MySQL" ]; then
+    elif [ X"${BACKEND}" == X"MYSQL" ]; then
         # Initialize MySQL.
         check_status_before_run mysql_initialize
         check_status_before_run mysql_import_vmail_users

iRedMail/functions/cleanup.sh

 
 cleanup_replace_mysql_config()
 {
-    if [ X"${BACKEND}" == X"MySQL" -o X"${BACKEND}" == X"OpenLDAP" ]; then
+    if [ X"${BACKEND}" == X"MYSQL" -o X"${BACKEND}" == X"OPENLDAP" ]; then
         # Both MySQL and OpenLDAP will need MySQL database server, so prompt
         # this config file replacement.
         ECHO_QUESTION "Would you like to use MySQL configuration file shipped within iRedMail now?"

iRedMail/functions/cluebringer.sh

 USE ${CLUEBRINGER_DB_NAME};
 EOF
 
-        if [ X"${BACKEND}" == X"OpenLDAP" -o X"${BACKEND}" == X"MySQL" ]; then
+        if [ X"${BACKEND}" == X"OPENLDAP" -o X"${BACKEND}" == X"MYSQL" ]; then
             gunzip -c /usr/share/doc/postfix-cluebringer/database/policyd-db.mysql.gz >> ${tmp_sql}
-        elif [ X"${BACKEND}" == X"PostgreSQL" ]; then
+        elif [ X"${BACKEND}" == X"PGSQL" ]; then
             gunzip -c /usr/share/doc/postfix-cluebringer/database/policyd-db.pgsql.gz >> ${tmp_sql}
         fi
 
 EOF
 
     ECHO_DEBUG "Setup user auth for cluebringer webui: ${CLUEBRINGER_HTTPD_CONF}."
-    if [ X"${BACKEND}" == X"OpenLDAP" ]; then
+    if [ X"${BACKEND}" == X"OPENLDAP" ]; then
         # Use LDAP auth.
         cat >> ${CLUEBRINGER_HTTPD_CONF} <<EOF
     AuthType Basic
         [ X"${LDAP_USE_TLS}" == X"YES" ] && \
             perl -pi -e 's#(AuthLDAPUrl.*)(ldap://)(.*)#${1}ldaps://${3}#' ${CLUEBRINGER_HTTPD_CONF}
 
-    elif [ X"${BACKEND}" == X"MySQL" ]; then
+    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
             cat >> ${CLUEBRINGER_HTTPD_CONF} <<EOF

iRedMail/functions/dovecot1.sh

     user = ${VMAIL_USER_NAME}
 EOF
 
-    if [ X"${BACKEND}" == X"OpenLDAP" ]; then
+    if [ X"${BACKEND}" == X"OPENLDAP" ]; then
         cat >> ${DOVECOT_CONF} <<EOF
     passdb ldap {
         args = ${DOVECOT_LDAP_CONF}
 }
 EOF
 
-        if [ X"${BACKEND}" == X"OpenLDAP" ]; then
+        if [ X"${BACKEND}" == X"OPENLDAP" ]; then
             realtime_quota_db_name="${IREDADMIN_DB_NAME}"
             realtime_quota_db_user="${IREDADMIN_DB_USER}"
             realtime_quota_db_passwd="${IREDADMIN_DB_PASSWD}"
 
         # Create MySQL database ${IREDADMIN_DB_USER} and table 'used_quota'
         # which used to store realtime quota.
-        if [ X"${BACKEND}" == X"OpenLDAP" -a X"${USE_IREDADMIN}" != X"YES" ]; then
+        if [ X"${BACKEND}" == X"OPENLDAP" -a X"${USE_IREDADMIN}" != X"YES" ]; then
             # If iRedAdmin is not used, create database and import table here.
             mysql -h${MYSQL_SERVER} -P${MYSQL_PORT} -u${MYSQL_ROOT_USER} -p"${MYSQL_ROOT_PASSWD}" <<EOF
 # Create databases.
     if [ X"${DOVECOT_VERSION}" == X"1.2" ]; then
         backup_file ${DOVECOT_SHARE_FOLDER_CONF}
 
-        if [ X"${BACKEND}" == X"OpenLDAP" ]; then
+        if [ X"${BACKEND}" == X"OPENLDAP" ]; then
             share_folder_db_name="${IREDADMIN_DB_NAME}"
             share_folder_db_table="share_folder"
             share_folder_db_user="${IREDADMIN_DB_USER}"
 
         # Create MySQL database ${IREDADMIN_DB_USER} and table 'share_folder'
         # which used to store realtime quota.
-        if [ X"${BACKEND}" == X"OpenLDAP" -a X"${USE_IREDADMIN}" != X"YES" ]; then
+        if [ X"${BACKEND}" == X"OPENLDAP" -a X"${USE_IREDADMIN}" != X"YES" ]; then
             # If iRedAdmin is not used, create database and import table here.
             mysql -h${MYSQL_SERVER} -P${MYSQL_PORT} -u${MYSQL_ROOT_USER} -p"${MYSQL_ROOT_PASSWD}" <<EOF
 # Create databases.

iRedMail/functions/dovecot2.sh

 
     # Virtual mail accounts.
     # Reference: http://wiki2.dovecot.org/AuthDatabase/LDAP
-    if [ X"${BACKEND}" == X"OpenLDAP" ]; then
+    if [ X"${BACKEND}" == X"OPENLDAP" ]; then
         perl -pi -e 's#PH_USERDB_ARGS#$ENV{DOVECOT_LDAP_CONF}#' ${DOVECOT_CONF}
         perl -pi -e 's#PH_USERDB_DRIVER#ldap#' ${DOVECOT_CONF}
         perl -pi -e 's#PH_PASSDB_ARGS#$ENV{DOVECOT_LDAP_CONF}#' ${DOVECOT_CONF}
         perl -pi -e 's#(.*)/usr/bin/env bash.*#${1}/usr/local/bin/bash#' ${DOVECOT_QUOTA_WARNING_SCRIPT}
     fi
 
-    if [ X"${BACKEND}" == X"OpenLDAP" ]; then
+    if [ X"${BACKEND}" == X"OPENLDAP" ]; then
         backup_file ${DOVECOT_LDAP_CONF}
         cat > ${DOVECOT_LDAP_CONF} <<EOF
 ${CONF_MSG}
     fi
 
 
-        if [ X"${BACKEND}" == X"OpenLDAP" ]; then
+        if [ X"${BACKEND}" == X"OPENLDAP" ]; then
             realtime_quota_db_name="${IREDADMIN_DB_NAME}"
             realtime_quota_db_user="${IREDADMIN_DB_USER}"
             realtime_quota_db_passwd="${IREDADMIN_DB_PASSWD}"
 
         # Create MySQL database ${IREDADMIN_DB_USER} and table 'used_quota'
         # which used to store realtime quota.
-        if [ X"${BACKEND}" == X"OpenLDAP" -a X"${USE_IREDADMIN}" != X"YES" ]; then
+        if [ X"${BACKEND}" == X"OPENLDAP" -a X"${USE_IREDADMIN}" != X"YES" ]; then
             # If iRedAdmin is not used, create database and import table here.
             mysql -h${MYSQL_SERVER} -P${MYSQL_PORT} -u${MYSQL_ROOT_USER} -p"${MYSQL_ROOT_PASSWD}" <<EOF
 # Create databases.
     if [ X"${DOVECOT_VERSION}" == X"1.2" ]; then
         backup_file ${DOVECOT_SHARE_FOLDER_CONF}
 
-        if [ X"${BACKEND}" == X"OpenLDAP" ]; then
+        if [ X"${BACKEND}" == X"OPENLDAP" ]; then
             share_folder_db_name="${IREDADMIN_DB_NAME}"
             share_folder_db_table="share_folder"
             share_folder_db_user="${IREDADMIN_DB_USER}"
 
         # Create MySQL database ${IREDADMIN_DB_USER} and table 'share_folder'
         # which used to store realtime quota.
-        if [ X"${BACKEND}" == X"OpenLDAP" -a X"${USE_IREDADMIN}" != X"YES" ]; then
+        if [ X"${BACKEND}" == X"OPENLDAP" -a X"${USE_IREDADMIN}" != X"YES" ]; then
             # If iRedAdmin is not used, create database and import table here.
             mysql -h${MYSQL_SERVER} -P${MYSQL_PORT} -u${MYSQL_ROOT_USER} -p"${MYSQL_ROOT_PASSWD}" <<EOF
 # Create databases.

iRedMail/functions/iredadmin.sh

     # Copy sample configure file.
     cd ${IREDADMIN_HTTPD_ROOT}/
 
-    if [ X"${BACKEND}" == X"OpenLDAP" ]; then
+    if [ X"${BACKEND}" == X"OPENLDAP" ]; then
         cp settings.ini.ldap.sample settings.ini
-    elif [ X"${BACKEND}" == X"MySQL" ]; then
+    elif [ X"${BACKEND}" == X"MYSQL" ]; then
         cp settings.ini.mysql.sample settings.ini
     fi
 
 EOF
 
     # Import addition tables.
-    if [ X"${BACKEND}" == X"OpenLDAP" ]; then
+    if [ X"${BACKEND}" == X"OPENLDAP" ]; then
         mysql -h${MYSQL_SERVER} -P${MYSQL_PORT} -u${MYSQL_ROOT_USER} -p"${MYSQL_ROOT_PASSWD}" <<EOF
 USE ${IREDADMIN_DB_NAME};
 SOURCE ${SAMPLE_DIR}/used_quota.sql;
         settings.ini
 
     # Backend related settings.
-    if [ X"${BACKEND}" == X"OpenLDAP" ]; then
+    if [ X"${BACKEND}" == X"OPENLDAP" ]; then
         # Change backend.
         sed -i.tmp -e "/\[general\]/,/\[/ s#\(^backend =\).*#\1 ldap#" settings.ini
 
             -e "/\[ldap\]/,/\[/ s#\(^bind_pw =\).*#\1 ${LDAP_ADMIN_PW}#" \
             settings.ini
 
-    elif [ X"${BACKEND}" == X"MySQL" ]; then
+    elif [ X"${BACKEND}" == X"MYSQL" ]; then
         # Change backend.
         sed -i.tmp -e "/\[general\]/,/\[/ s#\(^backend =\).*#\1 mysql#" settings.ini
 

iRedMail/functions/iredapd.sh

     perl -pi -e 's#^(run_as_user).*#${1} = $ENV{IREDAPD_DAEMON_USER}#' iredapd.ini
     perl -pi -e 's#^(run_as_daemon).*#${1} = yes#' iredapd.ini
 
-    if [ X"${BACKEND}" == X"OpenLDAP" ]; then
+    if [ X"${BACKEND}" == X"OPENLDAP" ]; then
         # Set backend.
         perl -pi -e 's#^(backend).*#${1} = ldap#' iredapd.ini
 
         # Enable plugins.
         perl -pi -e 's#^(plugins).*#${1} = ldap_maillist_access_policy#' iredapd.ini
 
-    elif [ X"${BACKEND}" == X"MySQL" ]; then
+    elif [ X"${BACKEND}" == X"MYSQL" ]; then
         # Set backend.
         perl -pi -e 's#^(backend).*#${1} = mysql#' iredapd.ini
 

iRedMail/functions/packages.sh

             -o X"${DISTRO_CODENAME}" == X"natty" \
             -o X"${DISTRO_CODENAME}" == X"oneiric" \
             ]; then
-            if [ X"${BACKEND}" == X"OpenLDAP" ]; then
+            if [ X"${BACKEND}" == X"OPENLDAP" ]; then
                 ALL_PKGS="${ALL_PKGS} php-net-ldap2"
             fi
         fi
     #################################################
     # Backend: OpenLDAP or MySQL, and extra packages.
     #
-    if [ X"${BACKEND}" == X"OpenLDAP" ]; then
+    if [ X"${BACKEND}" == X"OPENLDAP" ]; then
         # OpenLDAP server & client.
         if [ X"${DISTRO}" == X"RHEL" ]; then
             ALL_PKGS="${ALL_PKGS} openldap${PKG_ARCH} openldap-clients${PKG_ARCH} openldap-servers${PKG_ARCH}"
         else
             :
         fi
-    elif [ X"${BACKEND}" == X"MySQL" ]; then
+    elif [ X"${BACKEND}" == X"MYSQL" ]; then
         # MySQL server & client.
         if [ X"${DISTRO}" == X"RHEL" ]; then
             # For Awstats.
             ALL_PKGS="${ALL_PKGS} postfix-cluebringer postfix-cluebringer-webui"
             ENABLED_SERVICES="${ENABLED_SERVICES} postfix-cluebringer"
 
-            if [ X"${BACKEND}" == X"OpenLDAP" -o X"${BACKEND}" == X"MySQL" ]; then
+            if [ X"${BACKEND}" == X"OPENLDAP" -o X"${BACKEND}" == X"MYSQL" ]; then
                 ALL_PKGS="${ALL_PKGS} postfix-cluebringer-mysql"
-            elif [ X"${BACKEND}" == X"PostgreSQL" ]; then
+            elif [ X"${BACKEND}" == X"PGSQL" ]; then
                 ALL_PKGS="${ALL_PKGS} postfix-cluebringer-pgsql"
             fi
         else
         if [ X"${DISTRO_CODENAME}" == X"oneiric" ]; then
             ALL_PKGS="${ALL_PKGS} dovecot-managesieved dovecot-sieve"
 
-            if [ X"${BACKEND}" == X"OpenLDAP" ]; then
+            if [ X"${BACKEND}" == X"OPENLDAP" ]; then
                 ALL_PKGS="${ALL_PKGS} dovecot-ldap dovecot-mysql"
-            elif [ X"${BACKEND}" == X"MySQL" ]; then
+            elif [ X"${BACKEND}" == X"MYSQL" ]; then
                 ALL_PKGS="${ALL_PKGS} dovecot-mysql"
-            elif [ X"${BACKEND}" == X"PostgreSQL" ]; then
+            elif [ X"${BACKEND}" == X"PGSQL" ]; then
                 ALL_PKGS="${ALL_PKGS} dovecot-pgsql"
             fi
         fi

iRedMail/functions/packages_freebsd.sh

     ENABLED_SERVICES="${ENABLED_SERVICES} mysql-server"
 
     # OpenLDAP v2.4. REQUIRED for LDAP backend.
-    if [ X"${BACKEND}" == X"OpenLDAP" ]; then
+    if [ X"${BACKEND}" == X"OPENLDAP" ]; then
         cat > /var/db/ports/openldap24/options <<EOF
 WITH_SASL=true
 WITH_FETCH=true
 
     # Awstats.
     if [ X"${USE_AWSTATS}" == X"YES" ]; then
-        if [ X"${BACKEND}" == X"MySQL" ]; then
+        if [ X"${BACKEND}" == X"MYSQL" ]; then
             ALL_PORTS="${ALL_PORTS} www/mod_auth_mysql_another"
         fi
 

iRedMail/functions/postfix.sh

 # Starting config.
 postfix_config_virtual_host()
 {
-    if [ X"${BACKEND}" == X"OpenLDAP" ]; then
+    if [ X"${BACKEND}" == X"OPENLDAP" ]; then
         check_status_before_run postfix_config_ldap
-    elif [ X"${BACKEND}" == X"MySQL" ]; then
+    elif [ X"${BACKEND}" == X"MYSQL" ]; then
         check_status_before_run postfix_config_mysql
     else
         :

iRedMail/functions/roundcubemail.sh

 EOF
 
     # Do not grant privileges while backend is not MySQL.
-    if [ X"${BACKEND}" == X"MySQL" ]; then
+    if [ X"${BACKEND}" == X"MYSQL" ]; then
         mysql -h${MYSQL_SERVER} -P${MYSQL_PORT} -u${MYSQL_ROOT_USER} -p"${MYSQL_ROOT_PASSWD}" <<EOF
 -- Grant privileges for Roundcubemail, so that user can change
 -- their own password and setting mail forwarding.
     # after message delete/move, the next message will be displayed
     perl -pi -e 's#(.*display_next.*=).*#${1} true;#' main.inc.php
 
-    if [ X"${BACKEND}" == X"OpenLDAP" ]; then
+    if [ X"${BACKEND}" == X"OPENLDAP" ]; then
         export LDAP_SERVER_HOST LDAP_SERVER_PORT LDAP_BIND_VERSION LDAP_BASEDN LDAP_ATTR_DOMAIN_RDN LDAP_ATTR_USER_RDN
         cd ${RCM_HTTPD_ROOT}/config/
         ECHO_DEBUG "Setting global LDAP address book in Roundcube."
         # Enable autocomplete for all address books.
         perl -pi -e 's#(.*autocomplete_addressbooks.*=)(.*)#${1} array("sql", "ldap_global");#' main.inc.php
 
-    #elif [ X"${BACKEND}" == X"MySQL" ]; then
+    #elif [ X"${BACKEND}" == X"MYSQL" ]; then
         # Set correct username, password and database name.
     #    perl -pi -e 's#(.*db_dsnw.*= )(.*)#${1}"$ENV{'PHP_CONN_TYPE'}://$ENV{'RCM_DB_USER'}:$ENV{'RCM_DB_PASSWD'}\@$ENV{'MYSQL_SERVER'}/$ENV{'VMAIL_DB'}";#' plugins/changepasswd/config.inc.php
     else
     # Require the new password to contain a letter and punctuation character
     perl -pi -e 's#(.*password_require_nonalpha.*=).*#${1} true;#' config.inc.php
 
-    if [ X"${BACKEND}" == X"MySQL" ]; then
+    if [ X"${BACKEND}" == X"MYSQL" ]; then
         perl -pi -e 's#(.*password_driver.*=).*#${1} "sql";#' config.inc.php
         perl -pi -e 's#(.*password_db_dsn.*= )(.*)#${1}"$ENV{'PHP_CONN_TYPE'}://$ENV{'RCM_DB_USER'}:$ENV{'RCM_DB_PASSWD'}\@$ENV{'MYSQL_SERVER'}/$ENV{'VMAIL_DB'}";#' config.inc.php
         perl -pi -e 's#(.*password_query.*=).*#${1} "UPDATE $ENV{'VMAIL_DB'}.mailbox SET password=%c,passwordlastchange=NOW() WHERE username=%u LIMIT 1";#' config.inc.php
         perl -pi -e 's#(.*password_hash_algorithm.*=).*#${1} "md5crypt";#' config.inc.php
         perl -pi -e 's#(.*password_hash_base64.*=).*#${1} false;#' config.inc.php
 
-    elif [ X"${BACKEND}" == X"OpenLDAP" ]; then
+    elif [ X"${BACKEND}" == X"OPENLDAP" ]; then
         # LDAP backend. Driver: ldap_simple.
         perl -pi -e 's#(.*password_driver.*=).*#${1} "ldap_simple";#' config.inc.php
         perl -pi -e 's#(.*password_ldap_host.*=).*#${1} "$ENV{LDAP_SERVER_HOST}";#' config.inc.php
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.