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:
authorMichael Boelen <michael.boelen@cisofy.com>2016-08-23 21:21:26 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2016-08-23 21:21:26 +0300
commitc11f7fc1cef26a6dbb6ed8484399966cb0c6465a (patch)
tree94ed6eca81f52be8976251abf9ac1af69ab6c119
parent8ac9721f43fbfaf84321a5f0f1045120a5c2cc9c (diff)
Do not show update message when using 'show' helper
-rw-r--r--include/consts1
-rw-r--r--include/functions36
-rw-r--r--include/parameters5
3 files changed, 23 insertions, 19 deletions
diff --git a/include/consts b/include/consts
index 06be3b7b..b29bf6f1 100644
--- a/include/consts
+++ b/include/consts
@@ -178,6 +178,7 @@ unset LANG
RPMBINARY=""
RUN_HELPERS=0
RUN_TESTS=1
+ RUN_UPDATE_CHECK=1
SAMHAINBINARY=""
SCAN_TEST_HEAVY=""; SCAN_TEST_MEDIUM=""; SCAN_TEST_LOW=""
SEARCH_PROFILES=""
diff --git a/include/functions b/include/functions
index 86cd6dc6..b912857d 100644
--- a/include/functions
+++ b/include/functions
@@ -245,26 +245,28 @@
CheckUpdates() {
PROGRAM_LV="0000000000"; DB_MALWARE_LV="0000000000"; DB_FILEPERMS_LV="0000000000"
- LYNIS_LV_RECORD="lynis-latest-version.cisofy.com."
- FIND=`which dig 2> /dev/null`
- if [ ! "${FIND}" = "" ]; then
- PROGRAM_LV=`dig +short +time=3 -t txt lynis-latest-version.cisofy.com 2> /dev/null | grep -v "connection timed out" | sed 's/[".]//g' | grep "^[1-9][0-9][0-9]$"`
- else
- FIND=`which host 2> /dev/null`
- if [ ! "${FIND}" = "" ]; then
- PROGRAM_LV=`host -t txt -W 3 lynis-latest-version.cisofy.com 2> /dev/null | grep -v "connection timed out" | awk '{ if ($1=="lynis-latest-version.cisofy.com" && $3=="text") { print $4 }}' | sed 's/"//g' | grep "^[1-9][0-9][0-9]$"`
- if [ "${PROGRAM_LV}" = "" ]; then PROGRAM_LV=0; fi
- else
- FIND=`which drill 2> /dev/null`
- if [ ! "${FIND}" = "" ]; then
- PROGRAM_LV=`drill txt ${LYNIS_LV_RECORD} | awk '{ if ($1=="lynis-latest-version.cisofy.com." && $4=="TXT") { print $5 }}' | tr -d '"' | grep "^[1-9][0-9][0-9]$"`
+ if [ ${RUN_UPDATE_CHECK} -eq 1 ]; then
+ LYNIS_LV_RECORD="lynis-latest-version.cisofy.com."
+ FIND=$(which dig 2> /dev/null)
+ if [ ! -z "${FIND}" ]; then
+ PROGRAM_LV=$(dig +short +time=3 -t txt lynis-latest-version.cisofy.com 2> /dev/null | grep -v "connection timed out" | sed 's/[".]//g' | grep "^[1-9][0-9][0-9]$")
+ else
+ FIND=$(which host 2> /dev/null)
+ if [ ! -z "${FIND}" ]; then
+ PROGRAM_LV=$(host -t txt -W 3 lynis-latest-version.cisofy.com 2> /dev/null | grep -v "connection timed out" | awk '{ if ($1=="lynis-latest-version.cisofy.com" && $3=="text") { print $4 }}' | sed 's/"//g' | grep "^[1-9][0-9][0-9]$")
if [ "${PROGRAM_LV}" = "" ]; then PROGRAM_LV=0; fi
- else
- LogText "Result: dig, drill or host not installed, update check skipped"
- UPDATE_CHECK_SKIPPED=1
+ else
+ FIND=$(which drill 2> /dev/null)
+ if [ ! -z "${FIND}" ]; then
+ PROGRAM_LV=$(drill txt ${LYNIS_LV_RECORD} | awk '{ if ($1=="lynis-latest-version.cisofy.com." && $4=="TXT") { print $5 }}' | tr -d '"' | grep "^[1-9][0-9][0-9]$")
+ if [ -z "${PROGRAM_LV}" ]; then PROGRAM_LV=0; fi
+ else
+ LogText "Result: dig, drill or host not installed, update check skipped"
+ UPDATE_CHECK_SKIPPED=1
+ fi
fi
fi
- fi
+ fi
}
diff --git a/include/parameters b/include/parameters
index 618b27e0..402743ee 100644
--- a/include/parameters
+++ b/include/parameters
@@ -115,12 +115,13 @@
# Show Lynis details
show)
CHECK_BINARIES=0
- RUN_HELPERS=1
HELPER="show"
+ QUIET=1
+ RUN_HELPERS=1
RUN_TESTS=0
+ RUN_UPDATE_CHECK=0
SKIP_PLUGINS=1
SHOW_TOOL_TIPS=0
- QUIET=1
SHOW_PROGRAM_DETAILS=0
shift; HELPER_PARAMS="$@"
break