Skip to content

Instantly share code, notes, and snippets.

@bmarini
Created April 16, 2010 21:06
Show Gist options
  • Save bmarini/368979 to your computer and use it in GitHub Desktop.
Save bmarini/368979 to your computer and use it in GitHub Desktop.
#!/bin/bash
PROGNAME="/app/script/delayed_job"
RAILS_ENV="production"
USER="user"
HOME="/home/user"
start() {
echo "Starting $PROGNAME"
sudo -u $USER /usr/bin/env HOME=$HOME RAILS_ENV=$RAILS_ENV $PROGNAME start
}
stop() {
echo "Stopping $PROGNAME"
sudo -u $USER /usr/bin/env HOME=$HOME RAILS_ENV=$RAILS_ENV $PROGNAME stop
}
restart() {
echo "Restarting $PROGNAME"
sudo -u $USER /usr/bin/env HOME=$HOME RAILS_ENV=$RAILS_ENV $PROGNAME restart
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment