Skip to content

Commit

Permalink
Add support for multiple values in sysctlval parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-cerny committed Nov 5, 2024
1 parent b355224 commit 7386be5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions shared/templates/sysctl/sce-bash.template
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ if [[ $? == 0 ]] ; then
fi
{{% endif %}}

{{% if SYSCTLVAL is string %}}
{{% if SYSCTLVAL == "" -%}}
expected_value="$XCCDF_VALUE_sysctl_{{{ SYSCTLID }}}_value"
{{%- else -%}}
Expand All @@ -84,4 +85,12 @@ check_sysctl_configuration "{{{ SYSCTLVAR }}}" "$expected_value"
if [[ $? == 0 ]] ; then
exit $XCCDF_RESULT_PASS
fi
{{% elif SYSCTLVAL is sequence %}}
{{% for x in SYSCTLVAL %}}
check_sysctl_configuration "{{{ SYSCTLVAR }}}" "{{{ x }}}"
if [[ $? == 0 ]] ; then
exit $XCCDF_RESULT_PASS
fi
{{% endfor %}}
{{% endif %}}
exit $XCCDF_RESULT_FAIL

0 comments on commit 7386be5

Please sign in to comment.