Fix end if in bash script