This new version exclude .bak and .date directories.

This commit is contained in:
Benoît S. 2019-01-25 10:40:51 +01:00
parent eeef28176e
commit d1317eb087

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