Skip to content

Instantly share code, notes, and snippets.

@leedo
Created May 23, 2011 13:37
Show Gist options
  • Save leedo/986698 to your computer and use it in GitHub Desktop.
Save leedo/986698 to your computer and use it in GitHub Desktop.
plackup startup script
#!/bin/sh
BASE=$HOME/src/usealice
NAME=imageproxy
PSGI=psgi/$NAME.psgi
LOG=log/$NAME.log
PID=var/$NAME.pid
STATUS=var/$NAME.status
PORT=5008
OPTS="--port $PORT --pid-file $PID --status-file $STATUS"
PLACKUP="plackup -s Twiggy -E deployment --access-log $LOG $PSGI"
cd $BASE
if [ -e $PID ]; then
echo "pid file found, restarting"
OPTS="$OPTS --restart"
else
echo "starting"
OPTS="$OPTS -- $PLACKUP"
fi
start_server $OPTS 2>&1 &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment