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>2016-05-03 15:57:53 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2016-05-03 15:57:53 +0300
commiteded02cfde6a48270b975d8390dac44b3ad22f35 (patch)
treef5aa20ddaade51615a4777a3642aadf2e4e546f7 /include/tests_containers
parenteda79af419d4d61ab6cc078d0c8f74bb8c031b98 (diff)
Rewritten counters and dealing with values
Diffstat (limited to 'include/tests_containers')
-rw-r--r--include/tests_containers8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/tests_containers b/include/tests_containers
index b5f1b6ce..6c5ddc1a 100644
--- a/include/tests_containers
+++ b/include/tests_containers
@@ -40,7 +40,7 @@
if [ ! "${FIND}" = "" ]; then
N=0
for I in ${FIND}; do
- N=`expr ${N} + 1`
+ N=$((N + 1))
ZONEID=`echo ${I} | cut -d ':' -f1`
ZONENAME=`echo ${I} | cut -d ':' -f2`
LogText "Result: found zone ${ZONENAME} (running)"
@@ -102,7 +102,7 @@
for I in ${FIND}; do
J=`echo ${I} | sed 's/:space:/ /g'`
LogText "Output: ${J}"
- COUNT=`expr ${COUNT} + 1`
+ COUNT=$((COUNT + 1))
done
Display --indent 8 --text "- Docker info output (warnings)" --result "${COUNT}" --color RED
ReportSuggestion "${TEST_NO}" "Run 'docker info' to see warnings applicable to Docker daemon"
@@ -154,7 +154,7 @@
# Check if there aren't too many unused containers on the system
if [ ${DOCKER_CONTAINERS_TOTAL} -gt 0 ]; then
- DOCKER_CONTAINERS_UNUSED=`expr ${DOCKER_CONTAINERS_TOTAL} - ${DOCKER_CONTAINERS_RUNNING}`
+ DOCKER_CONTAINERS_UNUSED=$((DOCKER_CONTAINERS_TOTAL - DOCKER_CONTAINERS_RUNNING))
if [ ${DOCKER_CONTAINERS_UNUSED} -gt 10 ]; then
ReportSuggestion "${TEST_NO}" "More than 10 unused containers found on the system. Clean up old containers by using output of 'docker ps -a' command"
Display --indent 8 --text "- Unused containers" --result "${DOCKER_CONTAINERS_UNUSED}" --color RED
@@ -183,7 +183,7 @@
if IsWorldWritable ${I}; then
LogText "Result: file is writable by others, which is a security risk (e.g. privilege escalation)"
ReportWarning "${TEST_NO}" "Docker file is world writable" "${I}" "-"
- DOCKER_FILE_PERMISSIONS_WARNINGS=`expr ${DOCKER_FILE_PERMISSIONS_WARNINGS} + 1`
+ DOCKER_FILE_PERMISSIONS_WARNINGS=$((DOCKER_FILE_PERMISSIONS_WARNINGS + 1))
else
LogText "Result: file is not writable by others, which is fine"
fi