#!/bin/bash export HOME="/home/<%= scripts.ec2.params.ssh_user %>" if [ $1 = "ALL_QUEUES" ];then QUEUE=* else QUEUE=$1 fi sudo su -l www-data --command "cd /opt/gs && QUEUE=$QUEUE VERBOSE=1 PIDFILE=tmp/pids/resque_$1_$2.pid nohup bundle exec rake environment resque:work >> log/resque_worker_$1_$2.log 2>&1 &"