IMP(shellcheck): replace ls parsing by stat

This commit is contained in:
Thibault Ayanides
2020-12-14 16:14:37 +01:00
parent cdaee7786a
commit f4ba90352b
6 changed files with 13 additions and 10 deletions

View File

@ -27,6 +27,7 @@ ACCEPTED_SHELLS_GREP=''
audit() {
shells_to_grep_helper
info "Checking if admin accounts have a login shell different than $ACCEPTED_SHELLS"
# shellcheck disable=SC2086
RESULT=$(grep -Ev "^\+" "$FILE" | awk -F: '($1!="root" && $1!="sync" && $1!="shutdown" && $1!="halt" && $3<1000 ) {print}' | grep -v $ACCEPTED_SHELLS_GREP || true)
IFS_BAK=$IFS
IFS=$'\n'
@ -55,6 +56,7 @@ audit() {
# This function will be called if the script status is on enabled mode
apply() {
# shellcheck disable=SC2086
RESULT=$(grep -Ev "^\+" "$FILE" | awk -F: '($1!="root" && $1!="sync" && $1!="shutdown" && $1!="halt" && $3<1000 ) {print}' | grep -v $ACCEPTED_SHELLS_GREP || true)
IFS_BAK=$IFS
IFS=$'\n'