Check_env function parsing and check_env Parsing

Source: Internet
Author: User

Check_env function parsing and check_env 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 an existing configuration file
            read_setting ${AUTO_USE_EXISTING_CONFIG_FILE}
# Select whether to use an existing configuration file or reinstall it.
            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                    # should be a variable in ${STATUS_FILE}, e.g.                    #                    #   export STATUS_PHP_INSTALLATION='DONE'                    #   export 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.