Converted if statements into case-esac.