[AUTH-9406] - Readability and code style changes

This commit is contained in:
Michael Boelen 2016-07-30 16:08:45 +02:00
parent 6375953b26
commit d776c30b06
1 changed files with 14 additions and 13 deletions

View File

@ -1209,22 +1209,23 @@
Register --test-no AUTH-9406 --preqs-met ${PREQS_MET} --weight L --network NO --category security --description "Query LDAP servers in client configuration"
if [ ${SKIPTEST} -eq 0 ]; then
LogText "Test: checking ldap.conf options"
for I in ${LDAP_CONF_LOCATIONS}; do
LogText "Test: checking ${I}"
if [ -f ${I} ]; then
LogText "Result: file ${I} exists, LDAP being used"
LDAP_CLIENT_CONFIG_FILE="${I}"
LogText "Test: checking LDAP servers in file ${I}"
FIND2=`egrep "^host " ${I} | awk '{ print $2 }'`
for I in ${FIND2}; do
Display --indent 6 --text "LDAP server: ${I}"
LogText "Result: found LDAP server ${I}"
Report "ldap_server[]=${I}"
for FILE in ${LDAP_CONF_LOCATIONS}; do
LogText "Test: checking ${FILE}"
if [ -f ${FILE} ]; then
LogText "Result: file ${FILE} exists, LDAP being used"
LDAP_CLIENT_CONFIG_FILE="${FILE}"
LogText "Test: checking LDAP servers in file ${FILE}"
FIND=$(egrep "^host " ${FILE} | awk '{ print $2 }')
for SERVER in ${FIND}; do
Display --indent 6 --text "LDAP server: ${SERVER}"
LogText "Result: found LDAP server ${SERVER}"
Report "ldap_server[]=${SERVER}"
done
else
LogText "Result: ${I} does NOT exist"
else
LogText "Result: ${FILE} does NOT exist"
fi
done
unset FILE FIND SERVER
fi
#
#################################################################################