Properly check if CheckUpdates output is usable for display

This commit is contained in:
mboelen 2014-09-08 19:59:01 +02:00
parent 7867241d79
commit c3494b32d1
1 changed files with 2 additions and 2 deletions

View File

@ -111,13 +111,13 @@
PROGRAM_LV="0000000000"; DB_MALWARE_LV="0000000000"; DB_FILEPERMS_LV="0000000000"
FIND=`which dig 2> /dev/null`
if [ ! "${FIND}" = "" ]; then
PROGRAM_LV=`dig +short -t txt lynis-lv.rootkit.nl 2> /dev/null | sed 's/[".]//g'`
PROGRAM_LV=`dig +short +time=3 -t txt lynis-lv.rootkit.nl 2> /dev/null | grep -v "connection timed out" | sed 's/[".]//g'`
#DB_MALWARE_LV=`dig +short -t txt lynis-mw.rootkit.nl 2> /dev/null | sed 's/[".]//g'`
#DB_FILEPERMS_LV=`dig +short -t txt lynis-fp.rootkit.nl 2> /dev/null | sed 's/[".]//g'`
else
FIND=`which host 2> /dev/null`
if [ ! "${FIND}" = "" ]; then
PROGRAM_LV=`host -t txt lynis-lv.rootkit.nl 2> /dev/null | awk '{ if ($1=="lynis-lv.rootkit.nl" && $3=="text") { print $4 }}' | sed 's/"//g'`
PROGRAM_LV=`host -t txt -W 3 lynis-lv.rootkit.nl 2> /dev/null | grep -v "connection timed out" | awk '{ if ($1=="lynis-lv.rootkit.nl" && $3=="text") { print $4 }}' | sed 's/"//g'`
if [ "${PROGRAM_LV}" = "" ]; then PROGRAM_LV=0; fi
else
logtext "Result: dig and host not installed, update check skipped"