New Idea
0 Kudos

See the modifications to the prompts in this routine below:

 

do_prompt_join ()
{
    echo $ECHO_FLAG "\n${THIS_PRG_NAME}: do_prompt_join: " >> ${LOG_FILE}
    echo ""
    # ADCHECK
    if [ -n "${ADCHECK_FNAME}" ]; then
        QUESTION="Do you want to run adcheck to verify your AD environment? (Q|Y|N) [Y]:\c"; do_ask_YorN; ADCHECK=${ANSWER}
        if [ "${ADCHECK}" = "Y" ]; then
            # DOMAIN
            QUESTION="\nPlease enter the Active Directory domain to check [${DOMAIN}]: \c"; do_ask
            if [ "${ANSWER}" != "" ]; then DOMAIN=${ANSWER}; fi
            while [ "${DOMAIN}" = "" -o "${DOMAIN}" = "company.com" ]
            do
                QUESTION="\nPlease enter the Active Directory domain to check [${DOMAIN}]: \c"; do_ask
                if [ "${ANSWER}" != "" ]; then DOMAIN=${ANSWER}; fi
            done
        else
            ADCHECK_RC=""
        fi
    fi

    # ADJOIN
    if [ "${ADJOINED}" = "Y" ]; then
        ANSWER="n"; ADJOIN=${ANSWER}
    elif [ -n "${ADJOIN_CMD_OPTIONS}" ]; then
        ANSWER="n"; ADJOIN=${ANSWER}
    else
        QUESTION="Join an Active Directory domain? (Q|Y|N) [Y]:\c"; do_ask_YorN; ADJOIN=${ANSWER}
    fi
    if [ "${ADJOIN}" = "Y" ]; then
        # DOMAIN
        QUESTION="    Enter the Active Directory domain to join [${DOMAIN}]: \c"; do_ask
        if [ "${ANSWER}" != "" ]; then DOMAIN=${ANSWER}; fi
        while [ "${DOMAIN}" = "" -o "${DOMAIN}" = "company.com" ]
        do
            QUESTION="    Enter the Active Directory domain to join [${DOMAIN}]: \c"; do_ask
            if [ "${ANSWER}" != "" ]; then DOMAIN=${ANSWER}; fi
        done
        # USERID
        QUESTION="    Enter the Active Directory authorized user [${USERID:-Administrator}]: \c"; do_ask
        if [ "${ANSWER}" != "" ]; then USERID=${ANSWER}; fi
        # PASSWD
        PASSWD=""
        while [ "${PASSWD}" = "" ]
        do
            echo $ECHO_FLAG "    Enter the password for the Active Directory user: \c"
            STTY_SAVE=`stty -g`
            stty -echo
            read PASSWD;
            stty ${STTY_SAVE}
            echo ""
            if [ "${PASSWD}" = "q" -o "${PASSWD}" = "Q" ]; then do_quit; fi
        done
        # COMPUTER
        QUESTION="    Enter the computer name [${COMPUTER}]: \c"; do_ask
        if [ "${ANSWER}" != "" ]; then COMPUTER=${ANSWER}; fi
        # CONTAINER
        QUESTION="    Enter the container DN [${CONTAINER:-Computers}]: \c"; do_ask
        if [ "${ANSWER}" != "" ]; then CONTAINER=${ANSWER}; fi
        # ZONE
        if [ "${ADLICENSE}" != "N" ]; then
            ZONE=""
            while [ "${ZONE}" = "" ]
            do
                QUESTION="    Enter the name of the zone: \c"; do_ask
                if [ "${ANSWER}" != "" ]; then ZONE=${ANSWER}; fi
            done
        fi
        # SERVER
        QUESTION="    Enter the name of the domain controller [auto detect]: \c"; do_ask
        if [ "${ANSWER}" != "" ]; then SERVER=${ANSWER}; fi
    fi

    # CDA auditing
    check_auditing

    if [ "${DA_ENABLE}" != "enabled" ]; then
        if [ "${cda}" = "S=I+K" -o "${cda}" = "S=I+R" -o "${cda}" = "S+Y" ] || \
           [ "${cda}" = "S+I+K" -o "${cda}" = "S+I+U" -o "${cda}" = "I+K" ]; then
            if [ "${cda}" = "S=I+K" -o "${cda}" = "S+I+K" -o "${cda}" = "I+K" ]; then
                CDA_VER_AFTER=${CDA_CUR_VER} # "keep" so current CDA ver
            else
                CDA_VER_AFTER=${CDA_VER} # use new CDA ver
            fi
            if [ "`compare_ver ${CDA_VER_AFTER} 2.1.0; echo ${COMPARE}`" = "lt" ]; then
                # Only DA 2.0 (or older) requires to join domain
                if [ "${ADJOIN}" = "Y" -o "${ADJOINED}" = "Y" -o -n "${ADJOIN_CMD_OPTIONS}" ]; then
                    QUESTION="Enable auditing for all shells on this computer? (Q|Y|N) [Y]:\c"; do_ask_YorN; DA_ENABLE=${ANSWER}
                fi
            else
                QUESTION="Enable auditing on this computer (DirectAudit NSS mode)? (Q|Y|N) [Y]:\c"; do_ask_YorN; DA_ENABLE=${ANSWER}
            fi 
        fi 
    fi

    # REBOOT
    if [ "${ADJOIN}" = "Y" -o "${ADJOINED}" = "Y" -o -n "${ADJOIN_CMD_OPTIONS}" ]; then
        QUESTION="Reboot the computer after installation? (Q|Y|N) [${REBOOT:-Y}]:\c"; do_ask_YorN ${REBOOT:-Y}; REBOOT=${ANSWER}
    fi
    return $TRUE
} # do_prompt_join()

 

Announcements
Got an idea or suggestion on the product, we want to hear and also have the community vote to help us understand the use across the board. Check back from time to time to see new ideas and status updates