From a4437c47ac0bd22cd7f5aaa8e7895cdd8e93a317 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sun, 2 Feb 2020 18:14:10 +0100 Subject: utils/morty.sh: add script to install morty result proxy Signed-off-by: Markus Heiser --- utils/searx.sh | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) (limited to 'utils/searx.sh') diff --git a/utils/searx.sh b/utils/searx.sh index 47aad286b..204386fa8 100755 --- a/utils/searx.sh +++ b/utils/searx.sh @@ -17,10 +17,11 @@ SEARX_URL_PATH="${SEARX_URL_PATH:-$(echo "${PUBLIC_URL}" \ SEARX_INSTANCE_NAME="${SEARX_INSTANCE_NAME:-searx@$(echo "$PUBLIC_URL" \ | sed -e 's,^.*://\([^\:/]*\).*,\1,g') }" -SERVICE_USER="searx" +SERVICE_NAME="searx" +SERVICE_USER="${SERVICE_USER:-${SERVICE_NAME}}" +SERVICE_HOME="/home/${SERVICE_USER}" # shellcheck disable=SC2034 SERVICE_GROUP="${SERVICE_USER}" -SERVICE_HOME="/home/${SERVICE_USER}" SEARX_INTERNAL_URL="127.0.0.1:8888" SEARX_GIT_URL="https://github.com/asciimoo/searx.git" @@ -65,7 +66,7 @@ usage() { # shellcheck disable=SC1117 cat <&1 | prefix_stdout "$_service_prefix" cd ${SEARX_SRC} @@ -500,8 +501,10 @@ EOF uWSGI_app_available "$SEARX_UWSGI_APP" \ || err_msg "uWSGI app $SEARX_UWSGI_APP not available!" - if ! service_is_available "http://$SEARX_INTERNAL_URL"; then - err_msg "uWSGI app (service) at http://$SEARX_INTERNAL_URL is not available!" + if ! service_is_available "http://${SEARX_INTERNAL_URL}"; then + err_msg "uWSGI app (service) at http://${SEARX_INTERNAL_URL} is not available!" + echo -e "${_Green}stop with [${_BCyan}CTRL-C${_Green}] or .." + wait_key fi if ! service_is_available "${PUBLIC_URL}"; then @@ -514,15 +517,18 @@ EOF _debug_on=1 fi echo - systemctl --no-pager -l status uwsgi.service + systemctl --no-pager -l status "${SERVICE_NAME}" echo + # shellcheck disable=SC2059 + info_msg "public URL --> ${PUBLIC_URL}" + info_msg "internal URL --> http://${SEARX_INTERNAL_URL}" printf "// use ${_BCyan}CTRL-C${_creset} to stop monitoring the log" read -r -s -n1 -t 2 echo while true; do trap break 2 - #journalctl -f -u uwsgi.service + #journalctl -f -u "${SERVICE_NAME}" tail -f /var/log/uwsgi/app/searx.log done -- cgit v1.2.3