The exit statements in each status check if statement do not ... Not really understand why your script ...
stackoverflow.com