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