mirror of
https://github.com/ovh/debian-cis.git
synced 2025-06-24 03:24:34 +02:00
IMP(shellcheck): disable sed replacement (SC2001)
Shellcheck recommands to replace sed by shell expansions in 'simple' cases. However, the replacement here is likely to lead to erros, so we disable this rule. Moreover, it does'nt really add readability.
This commit is contained in:
@ -24,6 +24,7 @@ audit() {
|
||||
if $SUDO_CMD [ ! -r $CONF_FILE ]; then
|
||||
crit "$CONF_FILE is not readable"
|
||||
else
|
||||
# shellcheck disable=SC2001
|
||||
does_pattern_exist_in_file $CONF_FILE "$(sed 's/ /[[:space:]]+/g' <<<"$CONF_LINE")"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$CONF_LINE is present in $CONF_FILE"
|
||||
@ -38,6 +39,7 @@ apply() {
|
||||
if $SUDO_CMD [ ! -r $CONF_FILE ]; then
|
||||
crit "$CONF_FILE is not readable"
|
||||
else
|
||||
# shellcheck disable=SC2001
|
||||
does_pattern_exist_in_file $CONF_FILE "$(sed 's/ /[[:space:]]+/g' <<<"$CONF_LINE")"
|
||||
if [ "$FNRET" = 0 ]; then
|
||||
ok "$CONF_LINE is present in $CONF_FILE"
|
||||
|
Reference in New Issue
Block a user