diff options
Diffstat (limited to 'hex-zero.wsgi')
-rwxr-xr-x | hex-zero.wsgi | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/hex-zero.wsgi b/hex-zero.wsgi index d3979ee..c3f7747 100755 --- a/hex-zero.wsgi +++ b/hex-zero.wsgi @@ -8,12 +8,15 @@ test -z "${PIDFILE}" && export PIDFILE=/var/run/hex-zero.pid test -z "${LOGFILE}" && export LOGFILE=/var/log/hex-zero/hex-zero.log test -z "${UWSGI_OPTS}" && export UWSGI_OPTS="--http-socket ${LISTEN_HOST}:${LISTEN_PORT} --wsgi-file /var/www/0x0/hex-zero.py --callable app --log-x-forwarded-for --logto ${LOGFILE} --touch-reload /var/www/0x0/hex-zero.py --touch-reload /var/www/0x0/hex-zero.conf --pidfile ${PIDFILE} --uid ${UWSGI_USER}" -#test -n "${FORCE_KILL_OLD_UWSGI}" && { -# ps -o user=,pid=,command:80= -u "${UWSGI_USER}" | awk '/hex-zero\.py/{print $2}' | xargs --no-run-if-empty kill -#} +# check for short_url +/var/www/0x0/check-for-short_url.sh || exit 1 -test "${USER}" != "root" && test -n "${USER}" && { - printf "Please run $0 as user root. It will downgrade permissions when running uwsgi. Aborted.\n" 1>&2 ; exit 1 ; +test -n "${FORCE_KILL_OLD_UWSGI}" && { + ps -o user=,pid=,command:80= -u "${UWSGI_USER}" | awk '/hex-zero\.py/{print $2}' | xargs --no-run-if-empty kill +} + +test "${USER}" != "root" && test "${USER}" != "${UWSGI_USER}" && test -n "${USER}" && { + printf "Please run $0 as user root instead of ${USER}. It will downgrade permissions when running uwsgi. Aborted.\n" 1>&2 ; exit 1 ; } ${UWSGI_BIN} ${UWSGI_OPTS} |