diff --git a/evocheck.sh b/evocheck.sh index 9851b2a..56f5c55 100755 --- a/evocheck.sh +++ b/evocheck.sh @@ -857,8 +857,21 @@ if [ -e /etc/debian_version ]; then fi if [ "$IS_OLD_HOME_DIR" = 1 ]; then - find /home/ -maxdepth 1 -type d -nouser | grep -q '^' && echo 'IS_OLD_HOME_DIR FAILED!' - [ "${VERBOSE}" -eq 1 ] && find /home/ -maxdepth 1 -type d -nouser -exec stat -c "%n has owner %u resolved as %U" {} \; + for dir in /home/*; do + statResult=$(stat -c "%n has owner %u resolved as %U" "$dir" \ + | grep -Eve '.bak' -e '\.[0-9]{2}-[0-9]{2}-[0-9]{4}' \ + | grep UNKNOWN) + # There is at least one dir matching + if [[ -n "$statResult" ]]; then + if [[ "$VERBOSE" == 1 ]]; then + echo 'IS_OLD_HOME_DIR FAILED!' + echo "$statResult" + else + echo 'IS_OLD_HOME_DIR FAILED!' + break + fi + fi + done fi fi