File: bash.template

package info (click to toggle)
scap-security-guide 0.1.78-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 114,600 kB
  • sloc: xml: 245,305; sh: 84,381; python: 33,093; makefile: 27
file content (21 lines) | stat: -rw-r--r-- 978 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# platform = multi_platform_debian,multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_rhv,multi_platform_sle,multi_platform_slmicro,multi_platform_ubuntu,multi_platform_almalinux
{{#
   See the OVAL template for more comments.
   Product-specific categorization should be synced across all template content types
-#}}

{{%- if ARG_VARIABLE %}}
{{{- bash_instantiate_variables(ARG_VARIABLE) }}}
{{%- set ARG_NAME_VALUE = ARG_NAME ~ "=$" ~ ARG_VARIABLE %}}
{{% endif %}}

if {{{ bash_bootc_build() }}} ; then
    KARGS_DIR="/usr/lib/bootc/kargs.d/"
    if grep -q -E "{{{ ARG_NAME }}}" "$KARGS_DIR/*.toml" ; then
        sed -i -E "s/^(\s*kargs\s*=\s*\[.*)\"{{{ ARG_NAME }}}=[^\"]*\"(.*]\s*)/\1\"{{{ ARG_NAME_VALUE }}}\"\2/" "$KARGS_DIR/*.toml"
    else
        echo "kargs = [\"{{{ ARG_NAME_VALUE }}}\"]" >> "$KARGS_DIR/10-{{{ SANITIZED_ARG_NAME }}}.toml"
    fi
else
{{{ grub2_bootloader_argument_remediation(ARG_NAME, ARG_NAME_VALUE) | indent(4) }}}
fi