How to Redirect All Login Page to the Root Blog Login Page

Is there a script available in order to redirect all login pages of sub-blogs to the root blog (ex. http://blog1.example.com/wp-login.php will redirect to http://example.com/wp-login.php)? Or maybe I'm missing a settings?