mirror of
https://github.com/docker/docker-bench-security.git
synced 2025-01-19 00:32:34 +01:00
fix: allow combining include and exclude
Signed-off-by: wilmardo <info@wilmardenouden.nl>
This commit is contained in:
parent
c35d71f533
commit
1b37a1e6bc
1 changed files with 9 additions and 1 deletions
|
@ -144,7 +144,15 @@ main () {
|
||||||
else
|
else
|
||||||
for i in $(echo "$check" | sed "s/,/ /g"); do
|
for i in $(echo "$check" | sed "s/,/ /g"); do
|
||||||
if command -v "$i" 2>/dev/null 1>&2; then
|
if command -v "$i" 2>/dev/null 1>&2; then
|
||||||
|
if [ "$checkexclude" ]; then
|
||||||
|
checkexcluded="$(echo ",$checkexclude" | sed -e 's/^/\^/g' -e 's/,/\$|/g' -e 's/$/\$/g')"
|
||||||
|
included_checks=$(sed -ne "/$i() {/,/}/{/check/p}" functions_lib.sh | grep -vE "$checkexcluded")
|
||||||
|
for check in $included_checks; do
|
||||||
|
"$check"
|
||||||
|
done
|
||||||
|
else
|
||||||
"$i"
|
"$i"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "Check \"$i\" doesn't seem to exist."
|
echo "Check \"$i\" doesn't seem to exist."
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in a new issue