tiddlyweb/tiddlyweb — pull request #91 by FND (2014-01-17 15:36:45+00:00)
Title: PID management for twanager server

I frequently find myself writing scripts like this:

#!/usr/bin/env sh

set -e

if [ -f "server.pid" ]; then
kill `cat server.pid` || true
rm server.pid
fi

if [ "$1" = "-q" ]; then
exit 0
fi

twanager server &
echo "$!" > server.pid

it seemed like `twanager server` might as well (optionally) take care of this itself