Created
April 16, 2010 21:06
-
-
Save bmarini/368979 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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