Shell Script with mailq

Hi All,

I'm a unix starter.. Need your help please. I need to write a simple shell script to implement mail queue size check.

Pseudo code:

Run mailq command

If the queue size is greater than the predefined parameter (say 10), print message like : CRITICAL: Mail queue is XX . And exit 2

If the queue size is less than the predefined parameter (say 10), print message like : OK: Mail queue is XX. And Exit 0

Withdrawn -- sounds too much like Homework