Check_env function Parsing
It is also a long function used to check file permissions and directory conditions. The Code is as follows:
Check_env () {# Check user privilege. # Check User Permissions check_user root # Check FQDN hostname. # Check whether the host name meets the check_hostname rules # Check config tool: dialog. # Check whether the configuration tool dig_has check_pkg $ {BIN_DIALOG }$ {PKG_DIALOG} ECHO_INFO-n "Checking configuration file :$ {IREDMAIL_CONFIG_FILE }... "# Check whether the configuration file exists. The default installation package does not exist. It should be used to resume installation after the installation is interrupted. If [-f $ {IREDMAIL_CONFIG_FILE}]; then if grep '^ # EOF $' $ {IREDMAIL_CONFIG_FILE}>/dev/null; then echo-e "[FOUND]" ECHO_QUESTION-n "Use it for mail server setting? [Y | N] "# Read the existing configuration file read_setting $ {AUTO_USE_EXISTING_CONFIG_FILE} # select an existing configuration file, or reinstall case $ ANSWER in Y | y) ECHO_INFO "Use config file :$ {IREDMAIL_CONFIG_FILE} for mail server setting. ". $ {IREDMAIL_CONFIG_FILE} # Check installation status. # After each component installation was completed, there # shocould be a variable in $ {STATUS_FILE}, e.g. # export STATUS_PHP_INSTALLATION = 'done' # exp Ort STATUS_PHP_CONFIGURATION = 'done' # determine whether a status file exists. if yes, read the status file if [-f $ {STATUS_FILE}]; then ECHO_INFO "Import installation process status from file: $ {STATUS_FILE }. ". $ {STATUS_FILE} else echo ''>$ {STATUS_FILE} fi # Initialize tip file. if [! -F $ {TIP_FILE}]; then cat >$ {TIP_FILE} <EOF $ {CONF_MSG} EOF fi; N | n | *) ECHO_INFO "Skip configuration file: $ {IREDMAIL_CONFIG_FILE }. ". $ {CONFIG_VIA_DIALOG}; esac else ECHO_INFO "Found, but not finished. ". $ {CONFIG_VIA_DIALOG} fi else ECHO_INFO "[not found]". $ {CONFIG_VIA_DIALOG} fi check_runtime_dir}