mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-23 05:48:11 -05:00
20 lines
538 B
Bash
Executable File
20 lines
538 B
Bash
Executable File
#!/bin/bash
|
|
|
|
command=${UPSTART_JOB#reddit-consumers-}
|
|
while read consumer instance_count; do
|
|
# blank lines in the file should be ignored
|
|
if [ -z "$consumer" ]; then
|
|
continue
|
|
fi
|
|
|
|
# allow targeting which consumer the event is meant for (defaulting to 'all')
|
|
if [ ! -z "$TARGET" -a "x$TARGET" != "xall" -a "x$TARGET" != "x$consumer" ]; then
|
|
continue
|
|
fi
|
|
|
|
for i in $(seq 1 "$instance_count"); do
|
|
"/sbin/$command" "reddit-consumer-$consumer" "x=$i"
|
|
done
|
|
done < "$REDDIT_CONSUMER_CONFIG"
|
|
|