From 79e1f837ef7e7c402fd6e9dbb167aac695f2aee7 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Tue, 4 Feb 2020 10:39:42 +0100 Subject: utils & Makefile: add .config.mk & .config.sh for searx brands By isolating the environment of makefiles and bash scripts into .config.mk and .config.sh it is simple to maintain searx brands by setting some central environments. Signed-off-by: Markus Heiser --- utils/morty.sh | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) (limited to 'utils/morty.sh') diff --git a/utils/morty.sh b/utils/morty.sh index be741c2a4..ba4e7dd2e 100755 --- a/utils/morty.sh +++ b/utils/morty.sh @@ -11,17 +11,20 @@ source_dot_config # ---------------------------------------------------------------------------- PUBLIC_URL_PATH_MORTY="/morty" -PUBLIC_URL_MORTY="$(dirname ${PUBLIC_URL})${PUBLIC_URL_PATH_MORTY}" +PUBLIC_URL_MORTY="$(dirname "${PUBLIC_URL}")${PUBLIC_URL_PATH_MORTY}" MORTY_LISTEN="${MORTY_LISTEN:-127.0.0.1:3000}" +# shellcheck disable=SC2034 MORTY_TIMEOUT=5 SERVICE_NAME="morty" SERVICE_USER="${SERVICE_USER:-${SERVICE_NAME}}" -SERVICE_HOME="/home/${SERVICE_USER}" +SERVICE_HOME_BASE="${SERVICE_HOME_BASE:-/usr/local}" +SERVICE_HOME="${SERVICE_HOME_BASE}/${SERVICE_USER}" SERVICE_SYSTEMD_UNIT="${SYSTEMD_UNITS}/${SERVICE_NAME}.service" # shellcheck disable=SC2034 SERVICE_GROUP="${SERVICE_USER}" +# shellcheck disable=SC2034 SERVICE_ENV_DEBUG=false GO_ENV="${SERVICE_HOME}/.go_env" @@ -53,14 +56,15 @@ usage:: $(basename "$0") inspect [service] $(basename "$0") option [debug-on|debug-off] $(basename "$0") apache [install|remove] + $(basename "$0") info [searx] shell start interactive shell from user ${SERVICE_USER} install / remove all: complete setup of morty service - user: add/remove service user '$SERVICE_USER' at $SERVICE_HOME + user: add/remove service user '$SERVICE_USER' ($SERVICE_HOME) update morty - Update morty installation of user ${SERVICE_USER} + Update morty installation ($SERVICE_HOME) activate service activate and start service daemon (systemd unit) deactivate service @@ -77,17 +81,24 @@ If needed, set the environment variable MORTY_LISTEN in the ${DOT_CONFIG#"$REPO_ROOT/"} file:: MORTY_LISTEN : ${MORTY_LISTEN} - SERVICE_USER : ${SERVICE_USER} + SERVICE_USER : ${SERVICE_USER} +EOF + info_searx + [ ! -z ${1+x} ] && echo -e "$1" +} + +info_searx() { + # shellcheck disable=SC1117 + cat < http://${MORTY_LISTEN}" info_msg "public URL --> ${PUBLIC_URL_MORTY}" + # shellcheck disable=SC2059 printf "// use ${_BCyan}CTRL-C${_creset} to stop monitoring the log" read -r -s -n1 -t 2 echo -- cgit v1.2.3