From b74365b121984dd3c6d61b0d237da61b9a44565e Mon Sep 17 00:00:00 2001 From: pictuga Date: Wed, 29 Dec 2021 15:40:43 +0100 Subject: [PATCH] Make helper more posix compliant --- morss-helper | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) mode change 100755 => 100644 morss-helper diff --git a/morss-helper b/morss-helper old mode 100755 new mode 100644 index fb79efb..fdd42f3 --- a/morss-helper +++ b/morss-helper @@ -3,15 +3,15 @@ if ! command -v python && command -v python3 ; then alias python='python3' fi -function run { +run() { gunicorn --bind 0.0.0.0:${PORT:-8000} --preload --access-logfile - morss } -function daemon { +daemon() { gunicorn --bind 0.0.0.0:${PORT:-8000} --preload --access-logfile - --daemon morss } -function reload { +reload() { pid=$(pidof 'gunicorn: master [morss]') # NB. requires python-setproctitle if [ -z "$pid" ]; then @@ -27,11 +27,11 @@ function reload { fi } -function check { +check() { python -m morss.crawler http://localhost:${PORT:-8000}/ > /dev/null 2>&1 } -if [ "$1" = "sh" ] || [ "$1" = "bash" ] || [ "$(type -t "$1")" = "function" ]; then +if [ "$1" = "sh" ] || [ "$1" = "bash" ] || command -v "$1" ; then $@ else