Fix bash if test to be safer

This will solve an issue like :" line 11: [: =: unary operator expected" in the case one of the operators are empty or missing.