Merge branch 'IS_OLD_HOME_DIR-newversion' of evolix/evocheck into master

This commit is contained in:
Victor Laborie 2019-01-25 11:28:32 +01:00 committed by Gitea
commit be5d1978e5

View file

@ -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