diff options
author | Michael Boelen <michael.boelen@cisofy.com> | 2016-10-23 17:25:38 +0300 |
---|---|---|
committer | Michael Boelen <michael.boelen@cisofy.com> | 2016-10-23 17:25:38 +0300 |
commit | 270f2e4fb16c61beefb8e933ab46c81de77a7d10 (patch) | |
tree | e5d54f6a8aed0ef1e2a8d247dbdf939c2c8d4cb1 | |
parent | f18ef5c21029ba47773ad604a1c15ef26a3859c5 (diff) |
Improve logging and detection of domain name
-rw-r--r-- | include/tests_nameservices | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/include/tests_nameservices b/include/tests_nameservices index 43b491f2..51c28311 100644 --- a/include/tests_nameservices +++ b/include/tests_nameservices @@ -188,7 +188,7 @@ #fi LogText "Test: Checking if dnsdomainname command is available" - if [ ! "${DNSDOMAINNAMEBINARY}" = "" ]; then + if [ ! -z "${DNSDOMAINNAMEBINARY}" ]; then FIND2=$(${DNSDOMAINNAMEBINARY} 2> /dev/null) if [ ! "${FIND2}" = "" ]; then LogText "Result: dnsdomainname command returned a value" @@ -207,13 +207,12 @@ LogText "Result: using domain name from ${ROOTDIR}etc/resolv.conf" DOMAINNAME=${RESOLV_DOMAINNAME} else - LogText "Result: using domain name from FQDN hostname" - #DOMAINNAME=${FQDN#${HOSTNAME}.} - DOMAINNAME=`echo ${FQDN} | ${CUTBINARY} -d . -f2-` + LogText "Result: using domain name from FQDN hostname (${FQDN})" + DOMAINNAME=$(echo ${FQDN} | ${AWKBINARY} -F. '{print $2}') fi fi - if [ ! "${DOMAINNAME}" = "" ]; then + if [ ! -z "${DOMAINNAME}" ]; then LogText "Result: found domain name" Report "domainname=${DOMAINNAME}" Display --indent 2 --text "- Searching DNS domain name" --result "${STATUS_FOUND}" --color GREEN |