Source

yelp-challenge / server.sh

Full commit
#!/bin/bash

pidfile=server.pid

start() {
    nohup ipython2 notebook --pylab=inline&
    echo $! > ${pidfile}
}

stop() {
    test -f ${pidfile} && kill $(cat ${pidfile})
}

case $1 in
    -h | --help ) echo "usage: $(basename $0) start|stop|restart"; exit;;
    start ) start;;
    stop ) stop;;
    reload ) stop; start;;
    * ) echo "error: unknown command - ${1}"; exit 1;;
esac