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:
authorSiemKorteweg <Siem.Korteweg@qnh.nl>2015-10-10 14:25:14 +0300
committerSiemKorteweg <Siem.Korteweg@qnh.nl>2015-10-10 14:25:14 +0300
commit0c48fc3880551d862063e56a029ce43082df376a (patch)
treed57f59a582b3d457fccd0dad6f32b3513ebf294f /include/tests_logging
parentc0378f38f517e916b141a8bc5049eb742e66d48f (diff)
Optimized use of cat, grep and awk.
Detection of duplicate entries in /etc/hosts is now more robust. On CentOS7 the SERVICE_MANAGER is detected correctly.
Diffstat (limited to 'include/tests_logging')
-rw-r--r--include/tests_logging4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/tests_logging b/include/tests_logging
index 5e94576d..37728489 100644
--- a/include/tests_logging
+++ b/include/tests_logging
@@ -380,7 +380,7 @@
Register --test-no LOGG-2162 --preqs-met ${PREQS_MET} --weight L --network NO --description "Checking directories in /etc/newsyslog.conf"
if [ ${SKIPTEST} -eq 0 ]; then
logtext "Test: parsing directories from /etc/newsyslog.conf file"
- FIND=`cat /etc/newsyslog.conf | sort -u | grep "^/" | awk '{ print $1 }' | sed 's/\/*[a-zA-Z_.-]*$//g' | sort -u`
+ FIND=`awk '/^\// { print $1 }' /etc/newsyslog.conf | sed 's/\/*[a-zA-Z_.-]*$//g' | sort -u`
for I in ${FIND}; do
if [ -d ${I} ]; then
logtext "Result: Directory ${I} found and exists"
@@ -400,7 +400,7 @@
Register --test-no LOGG-2164 --preqs-met ${PREQS_MET} --weight L --network NO --description "Checking files specified /etc/newsyslog.conf"
if [ ${SKIPTEST} -eq 0 ]; then
logtext "Test: parsing files from /etc/newsyslog.conf file"
- FIND=`cat /etc/newsyslog.conf | sort -u | grep "^/" | awk '{ print $1 }'`
+ FIND=`awk '/^\// { print $1 }' /etc/newsyslog.conf | sort -u`
for I in ${FIND}; do
if [ -f ${I} ]; then
logtext "Result: File ${I} found and exists"