fi
echo
+echo "Handing home directories of existing users ..."
for old_account in "${!ACCOUNTS_MIGRATE[@]}" ; do
new_account="${ACCOUNTS_MIGRATE[${old_account}]}"
old_home="/home/${old_account}"
new_home="/home/${new_account}"
if [[ -d "${old_home}" ]] ; then
- echo "Handling '${old_home}' => '${new_home}' ..."
CUR_OWNER=$( stat --format "%U" "${old_home}" )
if [[ "${CUR_OWNER}" != "${new_account}" ]] ; then
echo "Chowning \"${old_home}\" to user \"${new_account}\": ..."
fi
fi
if [[ "${old_account}" != "${new_account}" ]] ; then
+ echo "Moving '${old_home}' => '${new_home}' ..."
if [[ -d "${new_home}" ]] ; then
echo "Cannot move '${old_home}' => '${new_home}', because the target dir is already existing."
else
done
echo
+echo "Removing home directories of non-existing users ..."
for old_account in "${ACCOUNTS_REMOVE[@]}" ; do
old_home="/home/${old_account}"
fi
done
+echo
+echo "Finished."