Reworked the bash if line per mpapis' suggestion in PR 1472.