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_snmp
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_snmp')
-rw-r--r--include/tests_snmp2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/tests_snmp b/include/tests_snmp
index 208df92a..5baba15a 100644
--- a/include/tests_snmp
+++ b/include/tests_snmp
@@ -75,7 +75,7 @@
if [ ${SKIPTEST} -eq 0 ]; then
WARN=0
logtext "Test: reading active snmp communities"
- FIND=`cat ${SNMPD_DAEMON_CONFIG} | grep "^com2sec" | ${AWKBINARY} '{ print $4 }'`
+ FIND=`${AWKBINARY} '/^com2sec/ { print $4 }' ${SNMPD_DAEMON_CONFIG}`
for I in ${FIND}; do
logtext "Output: ${I}"
if [ "${I}" = "public" -o "${I}" = "private" ]; then