Have you tried -p STDIN?
In reply to Re: How do I Determine if my script is being piped to? by BrowserUk in thread How do I Determine if my script is being piped to? by netguy