-#!/bin/bash -x
+#!/bin/bash
-running=`echo status | nc -w 1 localhost 4730 | grep ^poll_prefix | cut -d" " -f2`
+what=$1
+
+running=`echo status | nc -w 1 localhost 4730 | grep ^$what | cut -d" " -f2`
if [ "$running" -gt 0 ] ; then
- echo "poll allready queued!"
+ echo "$what allready queued!"
exit 1
fi
-time echo | gearman -N -f poll_prefix
+time echo | gearman -N -f $what