diff options
author | SiemKorteweg <Siem.Korteweg@qnh.nl> | 2015-10-04 18:59:28 +0300 |
---|---|---|
committer | SiemKorteweg <Siem.Korteweg@qnh.nl> | 2015-10-04 18:59:28 +0300 |
commit | bf1da50c145e22d672f99b7b1d912508bbed75b5 (patch) | |
tree | a78bd2dea59bedcd13c0acf15c15a7beb7ef5c66 /include/tests_webservers | |
parent | 6c4b790a22cc87f5cdf9451e36c9a1c06f0c4c95 (diff) |
Combine "sort | uniq" into "sort -u" to reduce the number of processes used for running Lynis. The busybox version of sort also supports the -u option.
Diffstat (limited to 'include/tests_webservers')
-rw-r--r-- | include/tests_webservers | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/tests_webservers b/include/tests_webservers index 08dfa7fa..8987636c 100644 --- a/include/tests_webservers +++ b/include/tests_webservers @@ -132,7 +132,7 @@ # Sort unsorted list, save it in temp file and then remove unsorted list if [ -f ${TMPFILE2} ]; then - sort ${TMPFILE2} | uniq >> ${TMPFILE} + sort -u ${TMPFILE2} >> ${TMPFILE} rm -f ${TMPFILE2} fi cVHOSTS=0; tVHOSTS="" @@ -442,7 +442,7 @@ done # Sort all discovered configuration lines and store unique ones. Also strip out the mime types configured in nginx - SORTFILE=`cat ${TMPFILE} | sort | uniq | sed 's/ /:space:/g' | egrep -v "(application|audio|image|text|video)/" | egrep -v "({|})"` + SORTFILE=`cat ${TMPFILE} | sort -u | sed 's/ /:space:/g' | egrep -v "(application|audio|image|text|video)/" | egrep -v "({|})"` for I in ${SORTFILE}; do I=`echo ${I} | sed 's/:space:/ /g'` report "nginx_config_option=${I}"; @@ -667,7 +667,7 @@ logtext "Test: Checking ${I}" if [ -d ${I} ]; then logtext "Result: Directory ${I} exists, so will be used as search path" - FIND=`find ${I} -type f -exec grep access_log \{\} \; | grep -v "#" | awk '{ if($1=="access_log") { print $2 } }' | sed 's/;$//g' | sort | uniq` + FIND=`find ${I} -type f -exec grep access_log \{\} \; | grep -v "#" | awk '{ if($1=="access_log") { print $2 } }' | sed 's/;$//g' | sort -u` if [ "${FIND}" = "" ]; then logtext "Result: no log files found" else |