It's doing what you told it to, executing the script rather than continuing with the shell. You can solve the problem by undoing the change you made. (From single-user mode if you don't have
ssh access or some other way in.)
Here's a tip: If you make changes to the login process, login shell, or login scripts, do not log out until you have confirmed that you can log back in. If you change anything that could conceivably prevent a system administrator from logging in, make sure you keep a logged in system administrator console until you confirm the changes work and that a system administrator can still log in.