Created
June 17, 2010 09:49
-
-
Save robb1e/441916 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
NAME=projectname | |
PORT=port | |
ENVIRONMENT=staging | |
URI=$NAME.$ENVIRONMENT | |
DIRECTORY=/mnt/apps/$ENVIRONMENT/$NAME | |
case "$1" in | |
start) | |
lsof -i :$PORT | |
if [ $? -eq 0 ]; then | |
echo "The port "$PORT" is already in use" | |
else | |
echo -n "Starting daemon: "$NAME | |
nohup grails -Dserver.port=$PORT -Duri=$URI prod run-app & | |
echo "." | |
fi | |
;; | |
stop) | |
echo -n "Stopping daemon: "$NAME | |
ps -ef | grep $PORT | grep -v grep | awk '{print "kill " $2}' | sh | |
echo "." | |
;; | |
*) | |
echo "Usage: "$1" {start|stop}" | |
exit 1 | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment