3 command=${UPSTART_JOB#reddit-consumers-}
4 for consumerpath
in $REDDIT_CONSUMER_CONFIG/*; do
5 consumer
=$
(basename $consumerpath)
7 # allow targeting which consumer the event is meant for (defaulting to 'all')
8 if [ ! -z "$TARGET" -a "x$TARGET" != "xall" -a "x$TARGET" != "x$consumer" ]; then
12 if [ -d $consumerpath ]; then
18 for typepath
in $types; do
19 instance_count
=$
(cat $typepath)
20 type_
=$
(basename $typepath)
22 for i
in $
(seq 1 "$instance_count"); do
23 "/sbin/$command" "reddit-consumer-$consumer" "type=$type_" "x=$i"