mirror of
https://github.com/docker/docker-bench-security.git
synced 2025-01-19 00:32:34 +01:00
make process count check a bit easier to read
Signed-off-by: Csaba Palfi <csaba@palfi.me>
This commit is contained in:
parent
1566929f87
commit
d7926a0f31
1 changed files with 2 additions and 2 deletions
|
@ -62,8 +62,8 @@ else
|
||||||
fail=0
|
fail=0
|
||||||
printcheck=0
|
printcheck=0
|
||||||
for c in $containers; do
|
for c in $containers; do
|
||||||
processes=$(docker exec "$c" ps -el 2>/dev/null | wc -l | awk '{print $1}')
|
processes=$(docker exec "$c" ps -el 2>/dev/null | tail -n +2 | grep -v "ps -el" | wc -l | tr -d ' ')
|
||||||
if [ "$processes" -gt 5 ]; then
|
if [ "$processes" -gt 1 ]; then
|
||||||
# If it's the first container, fail the test
|
# If it's the first container, fail the test
|
||||||
if [ $fail -eq 0 ]; then
|
if [ $fail -eq 0 ]; then
|
||||||
warn "$check_5_3"
|
warn "$check_5_3"
|
||||||
|
|
Loading…
Reference in a new issue