If you're using 4.2, the following works:
curl -s http://<user>:<pass>@localhost:9981/api/dvr/entry/grid_upcoming | grep -q '"sched_status":"recording",'
if [ "$?" == "0" ]; then
echo Recording...
else
echo Not recording...
fi
You'll need to replace <user> and <pass> with the correct credentials, the user needs some privilege or other (I run with the --no-acl option so I can't remember the exact setting).
HTH