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:
authorMichael Boelen <michael.boelen@cisofy.com>2019-09-19 15:05:15 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2019-09-19 15:05:15 +0300
commit36627a4eb7fb0d505c6df7897083d161e59cdf34 (patch)
tree5efa5a2f34c6683635259a97ebbbfd3ec1739629 /include/functions
parent950be03ddbc150d3b61b5ea620833a1991f32b3c (diff)
Style improvements
Diffstat (limited to 'include/functions')
-rw-r--r--include/functions18
1 files changed, 9 insertions, 9 deletions
diff --git a/include/functions b/include/functions
index 7d003976..0024484f 100644
--- a/include/functions
+++ b/include/functions
@@ -149,7 +149,7 @@
CreateTempFile
SETTINGS_FILE="${TEMP_FILE}"
fi
- FIND=$(egrep "^${SETTING};" ${SETTINGS_FILE})
+ FIND=$(grep -E "^${SETTING};" ${SETTINGS_FILE})
if [ -z "${FIND}" ]; then
echo "${SETTING};${VALUE};${DESCRIPTION};" >> ${SETTINGS_FILE}
else
@@ -227,7 +227,7 @@
if [ ! "${REPORTFILE}" = "/dev/null" ]; then
# Check if we can find the main type (with or without brackets)
LogText "Test: search string $2 in earlier discovered results"
- FIND=$(egrep "^$1(\[\])?=" ${REPORTFILE} | egrep "$2")
+ FIND=$(grep -E "^$1(\[\])?=" ${REPORTFILE} | grep -E "$2")
if HasData "${FIND}"; then
RETVAL=0
LogText "Result: found search string (result: $FIND)"
@@ -310,7 +310,7 @@
ContainsString() {
RETVAL=1
if [ $# -ne 2 ]; then ReportException "ContainsString" "Incorrect number of arguments for ContainsStrings function"; fi
- FIND=$(echo "$2" | egrep "$1")
+ FIND=$(echo "$2" | grep -E "$1")
if [ ! "${FIND}" = "" ]; then RETVAL=0; fi
return ${RETVAL}
}
@@ -1024,10 +1024,10 @@
elif [ -n "${IPBINARY}" ]; then
# Determine if we have the common available eth0 interface
- FIND=$(${IPBINARY} addr show eth0 2> /dev/null | egrep "link/ether " | head -1 | awk '{ print $2 }' | tr '[:upper:]' '[:lower:]')
+ FIND=$(${IPBINARY} addr show eth0 2> /dev/null | grep -E "link/ether " | head -1 | awk '{ print $2 }' | tr '[:upper:]' '[:lower:]')
if IsEmpty "${FIND}"; then
# Determine the MAC address of first interface with the ip command
- FIND=$(${IPBINARY} addr show 2> /dev/null | egrep "link/ether " | head -1 | awk '{ print $2 }' | tr '[:upper:]' '[:lower:]')
+ FIND=$(${IPBINARY} addr show 2> /dev/null | grep -E "link/ether " | head -1 | awk '{ print $2 }' | tr '[:upper:]' '[:lower:]')
if IsEmpty "${FIND}"; then
ReportException "GetHostID" "Can't create hostid (no MAC addresses found)"
fi
@@ -1816,7 +1816,7 @@
# FreeBSD: hw.hv_vendor (remains empty for VirtualBox)
# NetBSD: machdep.dmi.system-product
# OpenBSD: hw.product
- FIND=$(sysctl -a 2> /dev/null | egrep "(hw.product|machdep.dmi.system-product)" | head -1 | sed 's/ = /=/' | awk -F= '{ print $2 }')
+ FIND=$(sysctl -a 2> /dev/null | grep -E "(hw.product|machdep.dmi.system-product)" | head -1 | sed 's/ = /=/' | awk -F= '{ print $2 }')
if [ ! "${FIND}" = "" ]; then
SHORT="${FIND}"
fi
@@ -2694,7 +2694,7 @@
# Clean up temp files
for FILE in ${TEMP_FILES}; do
# Temporary files should be in /tmp
- TMPFILE=$(echo ${FILE} | egrep "^/tmp/lynis" | grep -v "\.\.")
+ TMPFILE=$(echo ${FILE} | grep -E "^/tmp/lynis" | grep -v "\.\.")
if [ -n "${TMPFILE}" ]; then
if [ -f "${TMPFILE}" ]; then
LogText "Action: removing temporary file ${TMPFILE}"
@@ -3108,7 +3108,7 @@
if [ -f ${FILE} ]; then
# Check if we can find the main type (with or without brackets)
LogText "Test: search string ${STRING} in file ${FILE}"
- FIND=$(egrep "${STRING}" ${FILE})
+ FIND=$(grep -E "${STRING}" ${FILE})
if [ -n "${FIND}" ]; then
LogText "Result: found search string '${STRING}'"
if [ ${MASK_LOG} -eq 0 ]; then LogText "Full string returned: ${FIND}"; fi
@@ -3459,7 +3459,7 @@
# Apply the related function
case ${FUNCTION} in
"contains")
- FIND=$(echo ${VALUE} | egrep "${SEARCH}")
+ FIND=$(echo ${VALUE} | grep -E "${SEARCH}")
if [ "${FIND}" = "" ]; then RETVAL=1; else RETVAL=0; fi
;;
#"gt" | "greater-than") COLOR=$GREEN ;;