FYI: The debian package's status scripts have sane exit values if you'd rather just check that.  (0 = services running, 1 = rpc stopped, 2 = web stopped, 3 = both stopped)