Yes, 'grep -q' simply returns a zero (true) result if a match is found and writes nothing on standard output.

I didn't know about this until relatively recently. The original Unix 'grep' I encountered didn't have this and you'd have to do things the way you did in your script. GNU grep was enhanced with many such features, which I think was a good thing personally. Others prefer the old "clean" way.