diff options
author | SiemKorteweg <Siem.Korteweg@qnh.nl> | 2015-10-10 14:25:14 +0300 |
---|---|---|
committer | SiemKorteweg <Siem.Korteweg@qnh.nl> | 2015-10-10 14:25:14 +0300 |
commit | 0c48fc3880551d862063e56a029ce43082df376a (patch) | |
tree | d57f59a582b3d457fccd0dad6f32b3513ebf294f /extras | |
parent | c0378f38f517e916b141a8bc5049eb742e66d48f (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 'extras')
-rwxr-xr-x | extras/build-lynis.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/extras/build-lynis.sh b/extras/build-lynis.sh index f0f6cc72..b4f4402e 100755 --- a/extras/build-lynis.sh +++ b/extras/build-lynis.sh @@ -212,7 +212,7 @@ if [ -f ${SOURCEFILE_RPM} ]; then if [ -f lynis.spec ]; then # adjust version in spec file - VERSION_IN_SPECFILE=`cat lynis.spec | grep "^Version:" | sed 's/ //g' | awk -F: '{ print $2 }'` + VERSION_IN_SPECFILE=`awk '/^Version:/ { print $2 }' lynis.spec` echo "[=] Found version ${VERSION_IN_SPECFILE}" if [ ${VERSION_IN_SPECFILE} = "" -o ! "${VERSION_IN_SPECFILE}" = "${LYNIS_VERSION}" ]; then echo "[X] Version in specfile is outdated" @@ -372,12 +372,12 @@ Exit #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= echo -n "- Creating MD5 hashes..." - PACKAGE_LIST_FILES=`cat files.dat | grep "^file:" | cut -d ':' -f3` + PACKAGE_LIST_FILES=`grep "^file:" files.dat | cut -d ':' -f3` for I in ${PACKAGE_LIST_FILES}; do echo -n "${I} " - #FULLNAME=`cat files.dat | grep ":file:include: + #FULLNAME=`grep ":file:include:" files.dat #echo "${FULLNAME}" >> ${OPENBSD_CONTENTS} echo "${I}" >> ${OPENBSD_CONTENTS} FILE="../${I}" |