From: Dobrica Pavlinusic Date: Mon, 20 Jun 2011 20:39:41 +0000 (+0200) Subject: specify poll_* to call from cron X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;ds=sidebyside;h=f940188b7dcf1c9c84400872eb99f5da9a8e5378;p=APKPM.git specify poll_* to call from cron --- diff --git a/cron.sh b/cron.sh index dd695e6..9736c03 100755 --- a/cron.sh +++ b/cron.sh @@ -1,10 +1,12 @@ -#!/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