Did you do a super search? This exact same problem has been discussed a few zillion times on PM.
Though here are a few big issues I have with your implementation:
you allow rsh as root?!? Are you insane?
you are wasting quite a bit of memory by sucking the output of the command into resultText, since all you do is suck it up and spit it back out directly.