Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormboelen <michael@cisofy.com>2014-09-08 21:59:01 +0400
committermboelen <michael@cisofy.com>2014-09-08 21:59:01 +0400
commitc3494b32d180bd6406f3614d4bb1ac59009b2031 (patch)
treec611edd082f71c78c501ad4985697b17bf050e7b /include
parent7867241d79dd52e6b26f5d7984ed8d0bf32cb538 (diff)
Properly check if CheckUpdates output is usable for display
Diffstat (limited to 'include')
-rw-r--r--include/functions4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/functions b/include/functions
index c0cb7ef5..86d2fefb 100644
--- a/include/functions
+++ b/include/functions
@@ -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"