#! /bin/sh if [ "$1" = "sh" ] || [ "$1" = "bash" ]; then exec $@ elif [ -z "$1" ] || [ "$@" = "run" ]; then gunicorn --bind 0.0.0.0:${PORT:-8000} --preload --access-logfile - morss elif [ "$@" = "reload" ]; then pid=$(pidof 'gunicorn: master [morss]') kill -s USR2 $pid kill -s WINCH $pid kill -s TERM $pid elif [ "$@" = "check" ]; then python -m morss.crawler http://localhost:${PORT:-8000}/ > /dev/null 2>&1 else morss $@ fi