Changed shebang to bash so if statements would work correctly.