Check_env function Parsing

Source: Internet
Author: User

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}

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.