Source

twisted-meetup / rund.sh

#!/bin/sh -x
# Run some server and reload it when code changes

RUN="$@"
PID="`pwd`/rund.pid"
LOG="`pwd`/rund.log"

if [ -z "$RUN" ]; then
    echo "Usage: rund <command>"
    exit 
fi

kicker -e "if test -e \"$PID\"; then cat $PID | xargs kill; fi && daemonize -c `pwd` -p $PID -v -a -o $LOG -e $LOG $RUN"