you have one if too much here but sure its a typo...
the problem comes from -eq which is normally for equal to, but for numeric value (integer...) which is not the case here (the shell is seeing a string...)
Im sure you replace by = and it should work...