Zhang Huangbin avatar Zhang Huangbin committed 589e8da

Variable named: IPTABLES_CONFIG -> FIREWALL_RULE_CONF.

Comments (0)

Files changed (2)

iRedMail/conf/global

     # Directory /etc/sysconfig/ on RHEL/CentOS.
     export ETC_SYSCONFIG_DIR='/etc/sysconfig'
 
-    # Iptables rule file.
-    export IPTABLES_CONFIG="${ETC_SYSCONFIG_DIR}/iptables"
+    # iptables rule file.
+    export FIREWALL_RULE_CONF="${ETC_SYSCONFIG_DIR}/iptables"
 
     # Directory used to store SSL/TLS key/cert file.
     export SSL_FILE_DIR="/etc/pki/tls"
     # Directory /etc/sysconfig/ on RHEL/CentOS/openSUSE.
     export ETC_SYSCONFIG_DIR='/etc/sysconfig'
 
-    # Iptables rule file.
-    export IPTABLES_CONFIG="${ETC_SYSCONFIG_DIR}/SuSEfirewall2"
+    # iptables rule file.
+    export FIREWALL_RULE_CONF="${ETC_SYSCONFIG_DIR}/SuSEfirewall2"
 
     # Directory used to store SSL/TLS key/cert file.
     export SSL_FILE_DIR="/etc/ssl"
     # Directory /etc/default/ on Debian/Ubuntu.
     export ETC_SYSCONFIG_DIR='/etc/default'
 
-    # Iptables rule file.
-    export IPTABLES_CONFIG="${ETC_SYSCONFIG_DIR}/iptables"
+    # iptables rule file.
+    export FIREWALL_RULE_CONF="${ETC_SYSCONFIG_DIR}/iptables"
 
     # Directory used to store SSL/TLS key/cert file.
     export SSL_FILE_DIR="/etc/ssl"
     # Directory /etc/sysconfig/ on RHEL/CentOS.
     export ETC_SYSCONFIG_DIR='/etc/conf.d'
 
-    # Iptables rule file.
-    export IPTABLES_CONFIG="/var/lib/iptables/rules-save"
+    # iptables rule file.
+    export FIREWALL_RULE_CONF="/var/lib/iptables/rules-save"
 
     # Directory used to store SSL/TLS key/cert file.
     export SSL_FILE_DIR="/etc/ssl"
     export ETC_SYSCONFIG_DIR='/etc/defaults'
 
     # IPFW rule file.
-    export IPTABLES_CONFIG="${ETC_SYSCONFIG_DIR}/ipfw.rules"
+    export FIREWALL_RULE_CONF="${ETC_SYSCONFIG_DIR}/ipfw.rules"
 
     # Directory used to store SSL/TLS key/cert file.
     export SSL_FILE_DIR="/etc/ssl"
     export CRON_SPOOL_DIR='/var/cron/tabs'
 
     # PF rule file.
-    export IPTABLES_CONFIG="/etc/pf.conf"
+    export FIREWALL_RULE_CONF="/etc/pf.conf"
 
     # Directory used to store SSL/TLS key/cert file.
     export SSL_FILE_DIR="/etc/ssl"

iRedMail/functions/cleanup.sh

     fi
 
     ECHO_QUESTION "Would you like to use firewall rules provided by iRedMail now?"
-    ECHO_QUESTION -n "File: ${IPTABLES_CONFIG}, with SSHD port: ${sshd_port}. [Y|n]"
+    ECHO_QUESTION -n "File: ${FIREWALL_RULE_CONF}, with SSHD port: ${sshd_port}. [Y|n]"
     read_setting ${AUTO_CLEANUP_REPLACE_FIREWALL_RULES}
     case $ANSWER in
         N|n ) ECHO_INFO "Skip firewall rules." ;;
         Y|y|* ) 
-            backup_file ${IPTABLES_CONFIG}
+            backup_file ${FIREWALL_RULE_CONF}
             if [ X"${KERNEL_NAME}" == X'LINUX' ]; then
                 if [ X"${DISTRO}" != X"SUSE" ]; then
-                    ECHO_INFO "Copy firewall sample rules: ${IPTABLES_CONFIG}."
-                    cp -f ${SAMPLE_DIR}/iptables.rules ${IPTABLES_CONFIG}
+                    ECHO_INFO "Copy firewall sample rules: ${FIREWALL_RULE_CONF}."
+                    cp -f ${SAMPLE_DIR}/iptables.rules ${FIREWALL_RULE_CONF}
 
                     # Replace HTTP port.
                     [ X"${HTTPD_PORT}" != X"80" ]&& \
-                        perl -pi -e 's#(.*)80(,.*)#${1}$ENV{HTTPD_PORT}${2}#' ${IPTABLES_CONFIG}
+                        perl -pi -e 's#(.*)80(,.*)#${1}$ENV{HTTPD_PORT}${2}#' ${FIREWALL_RULE_CONF}
                 fi
 
                 if [ X"${DISTRO}" == X"SUSE" ]; then
                     # Below services are not accessable from external network:
                     #   - ldaps (636)
-                    perl -pi -e 's/^(FW_SERVICES_EXT_TCP=)(.*)/${1}"$ENV{HTTPD_PORT} 443 25 110 995 143 993 587 465 $ENV{sshd_port}"\n#${2}/' ${IPTABLES_CONFIG}
+                    perl -pi -e 's/^(FW_SERVICES_EXT_TCP=)(.*)/${1}"$ENV{HTTPD_PORT} 443 25 110 995 143 993 587 465 $ENV{sshd_port}"\n#${2}/' ${FIREWALL_RULE_CONF}
 
                 elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
                     # Copy sample rc script for Debian.
                     eval ${enable_service} iptables >/dev/null
                 fi
             elif [ X"${KERNEL_NAME}" == X'OPENBSD' ]; then
-                ECHO_INFO "Copy firewall sample rules: ${IPTABLES_CONFIG}."
-                cp -f ${SAMPLE_DIR}/pf.conf ${IPTABLES_CONFIG}
+                ECHO_INFO "Copy firewall sample rules: ${FIREWALL_RULE_CONF}."
+                cp -f ${SAMPLE_DIR}/pf.conf ${FIREWALL_RULE_CONF}
             fi
 
             # Prompt to restart iptables.
                     ECHO_INFO "Restarting firewall ..."
 
                     if [ X"${DISTRO}" == X'OPENBSD' ]; then
-                        /sbin/pfctl -ef ${IPTABLES_CONFIG}
+                        /sbin/pfctl -ef ${FIREWALL_RULE_CONF}
                     else
                         # openSUSE will use /etc/init.d/SuSEfirewall2_{init,setup} instead.
                         if [ X"${DISTRO}" != X"SUSE" ]; then
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.