From fdf3ded89f7a205a69d150f2ba629f68ca46db5f Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Fri, 26 Aug 2016 14:05:20 +0200 Subject: New command 'lynis show details' to display test details --- include/helper_show | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/helper_show') diff --git a/include/helper_show b/include/helper_show index db5d6724..09baa9fa 100644 --- a/include/helper_show +++ b/include/helper_show @@ -209,6 +209,18 @@ if [ $# -gt 0 ]; then "dbdir") ${ECHOCMD} "${DBDIR}" ;; + "details") + if [ -z "${LOGFILE}" ]; then DisplayError "Could not find log file to parse"; fi + if [ $# -eq 1 ]; then + DisplayError "Provide a test ID" + else + shift + if [ $# -eq 1 ]; then + TESTID="$1" + awk -v search="Performing test ID $TESTID" '$0 ~ search {++f;p=1}p&&f==1;/===---/{p=0}' ${LOGFILE} + fi + fi + ;; "groups") ViewGroups ;; -- cgit v1.2.3