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>2020-04-01 17:18:03 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2020-04-01 17:18:03 +0300
commitf232b4f9bbb1592b37d2af4938f940b03a61d54d (patch)
tree4e8c5efa363877eb3ba79f7d488e59d87140fef0 /include/tests_filesystems
parent7e3c9448df1bea8344597bcc4a1732c51430bf1a (diff)
Added quotes
Diffstat (limited to 'include/tests_filesystems')
-rw-r--r--include/tests_filesystems15
1 files changed, 7 insertions, 8 deletions
diff --git a/include/tests_filesystems b/include/tests_filesystems
index 51d22760..aabdc2be 100644
--- a/include/tests_filesystems
+++ b/include/tests_filesystems
@@ -580,7 +580,7 @@
FS_FSTAB=""
fi
fi
- if [ -z "${FS_FSTAB}" ]; then # not found in fstab, check if mounted otherwise
+ if [ -z "${FS_FSTAB}" ]; then # not found in fstab, check if mounted otherwise
FS_FSTAB=$(mount | ${AWKBINARY} -v fs=${FILESYSTEM} '{ if ($3==fs) { print $6 } }')
FOUND_FLAGS=$(mount | ${AWKBINARY} -v fs=${FILESYSTEM} '{ if ($1~"[^#]" && $3==fs) { print $6 } }' | ${SEDBINARY} 's/,/ /g' | ${TRBINARY} '\n' ' ')
else
@@ -668,7 +668,6 @@
# Description : Check for nodirtime option
# Want to contribute to Lynis? Create this test
-
#
#################################################################################
#
@@ -676,7 +675,6 @@
# Description : Check for relatime
# Want to contribute to Lynis? Create this test
-
#
#################################################################################
#
@@ -695,12 +693,12 @@
if [ ${SKIPTEST} -eq 0 ]; then
SWAPLEVEL=$(${CAT_BINARY} /proc/sys/vm/swappiness)
LogText "Test: checking level of vm.swappiness: ${SWAPLEVEL}"
- PHYSDISK=$(${LSBLKBINARY} | ${GREPBINARY} -E 'disk|SWAP' | ${GREPBINARY} -B1 SWAP | ${HEADBINARY} -n1 | ${AWKBINARY} '{print $1}')
+ PHYSDISK=$(${LSBLKBINARY} | ${GREPBINARY} -E 'disk|SWAP' | ${GREPBINARY} -B1 SWAP | ${HEADBINARY} -n1 | ${AWKBINARY} '{print $1}')
if [ ${SWAPLEVEL} -gt 60 ]; then
LogText "Result: vm.swappiness=${SWAPLEVEL} meaning that swapping is more frequent than default."
- # Check if swap is on a HDD or SDD for frequent swapping
- if [ -d /sys/block/${PHYSDISK} ]; then
- HDDORSDD=$(${CAT_BINARY} /sys/block/${PHYSDISK}/queue/rotational)
+ # Check if swap is on a HDD or SDD for frequent swapping
+ if [ -d "/sys/block/${PHYSDISK}" ]; then
+ HDDORSDD=$(${CAT_BINARY} "/sys/block/${PHYSDISK}/queue/rotational")
if [ ${HDDORSDD} -eq 1 ]; then
ReportSuggestion "${TEST_NO}" "vm.swappiness set to: ${SWAPLEVEL} > 60 (default) - consider installing an SSD for swap partition for better performance."
fi
@@ -708,7 +706,7 @@
elif [ ${SWAPLEVEL} -eq 0 ]; then
LogText "Result: vm.swappiness=${SWAPLEVEL} meaning swapping is disabled."
ReportSuggestion "${TEST_NO}" "vm.swappiness set to: ${SWAPLEVEL}. Consider setting value to minimum of 1 for minimizing swappiness, but not quite disabling it. Will prevent OOM killer from killing processes when running out of physical memory."
- elif [ ${SWAPLEVEL} -eq 1]; then
+ elif [ ${SWAPLEVEL} -eq 1 ]; then
LogText "Result: vm.swappiness=${SWAPLEVEL} meaning that swapping can still occur but at very minimum."
elif [ ${SWAPLEVEL} -eq 10 ]; then
LogText "Result: vm.swappiness=${SWAPLEVEL} which is the preferred setting for database servers."
@@ -717,6 +715,7 @@
else
LogText "Result: vm.swappiness=${SWAPLEVEL} which is the standard level of swappiness and works well for desktop systems."
fi
+ if IsVerbose; then Display --indent 2 --text "- Swappiness: ${SWAPLEVEL}" --result "INFO" --color WHITE; fi
fi
#
#################################################################################