mirror of
https://github.com/ovh/debian-cis.git
synced 2025-06-24 03:24:34 +02:00
IMP(shellcheck): quote variables (SC2086)
This commit is contained in:
@ -23,10 +23,10 @@ RESULT=''
|
||||
# This function will be called if the script status is on enabled / audit mode
|
||||
audit() {
|
||||
info "Checking if accounts have a legacy password entry"
|
||||
if grep '^+:' $FILE -q; then
|
||||
RESULT=$(grep '^+:' $FILE)
|
||||
if grep '^+:' "$FILE" -q; then
|
||||
RESULT=$(grep '^+:' "$FILE")
|
||||
crit "Some accounts have a legacy password entry"
|
||||
crit $RESULT
|
||||
crit "$RESULT"
|
||||
else
|
||||
ok "All accounts have a valid password entry format"
|
||||
fi
|
||||
@ -34,12 +34,12 @@ audit() {
|
||||
|
||||
# This function will be called if the script status is on enabled mode
|
||||
apply() {
|
||||
if grep '^+:' $FILE -q; then
|
||||
RESULT=$(grep '^+:' $FILE)
|
||||
if grep '^+:' "$FILE" -q; then
|
||||
RESULT=$(grep '^+:' "$FILE")
|
||||
warn "Some accounts have a legacy password entry"
|
||||
for LINE in $RESULT; do
|
||||
info "Removing $LINE from $FILE"
|
||||
delete_line_in_file $FILE $LINE
|
||||
delete_line_in_file "$FILE" "$LINE"
|
||||
done
|
||||
else
|
||||
ok "All accounts have a valid password entry format"
|
||||
|
Reference in New Issue
Block a user