fix: further changes

This commit is contained in:
silver 2023-09-06 20:04:36 +00:00
parent fbbb675425
commit 882f9aa78e

View file

@ -27,6 +27,7 @@ iter_dirs(){
if [ "$username" != "$username_lower" ]; then
mv "$root/$username" "$root/$username_lower"
echo "Changed $username to $username_lower"
dir="$root/$username_lower"
username=$username_lower
fi
@ -34,6 +35,7 @@ iter_dirs(){
if [[ $username =~ ^[0-9] ]]; then
mv "$root/$username" "$root/_$username"
echo "Changed $username to _$username"
dir="$root/_$username"
username="_$username"
fi
@ -45,6 +47,8 @@ iter_dirs(){
if id "$username" &>/dev/null; then
change_owner_and_permissions "$dir" "$username"
echo "Changed owner and permissions of $dir to $username"
# else
# echo "User $username not found. Leaving $dir owned by root."
fi
fi
done