diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2021-10-29 18:09:44 +0200 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarit.de> | 2021-10-30 16:11:01 +0200 |
commit | 38482739de32ee6a6a41763c5b992c1ad689eb2e (patch) | |
tree | 4d926f1582faf123df10d32551b7640acb414cd4 /utils/searx.sh | |
parent | 2b1252148d083eb47382733980ec069ef20dcfb6 (diff) | |
download | searxng-38482739de32ee6a6a41763c5b992c1ad689eb2e.tar.gz searxng-38482739de32ee6a6a41763c5b992c1ad689eb2e.zip |
[mod] utils/searx.sh - check a SearXNG installation
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'utils/searx.sh')
-rwxr-xr-x | utils/searx.sh | 74 |
1 files changed, 40 insertions, 34 deletions
diff --git a/utils/searx.sh b/utils/searx.sh index 3f50646e3..baac48a90 100755 --- a/utils/searx.sh +++ b/utils/searx.sh @@ -141,7 +141,7 @@ usage() { cat <<EOF usage:: $(basename "$0") shell - $(basename "$0") install [all|init-src|dot-config|user|searx-src|pyenv|uwsgi|packages|settings|buildhost] + $(basename "$0") install [all|check|init-src|dot-config|user|searx-src|pyenv|uwsgi|packages|settings|buildhost] $(basename "$0") update [searx] $(basename "$0") remove [all|user|pyenv|searx-src] $(basename "$0") activate [service] @@ -154,7 +154,6 @@ shell start interactive shell from user ${SERVICE_USER} install / remove :all: complete (de-) installation of searx service - :check: check the SearXNG installation :user: add/remove service user '$SERVICE_USER' ($SERVICE_HOME) :dot-config: copy ./config.sh to ${SEARX_SRC} :searx-src: clone $GIT_URL @@ -164,6 +163,8 @@ install / remove :settings: reinstall settings from ${SEARXNG_SETTINGS_PATH} :packages: install needed packages from OS package manager :buildhost: install packages from OS package manager needed by buildhosts +install + :check: check the SearXNG installation update searx Update SearXNG installation ($SERVICE_HOME) activate service @@ -216,15 +217,15 @@ main() { install) sudo_or_exit case $2 in - check) - rst_title "SearXNG (check installation)" part - verify_continue_install - sudo -H -u "${SERVICE_USER}" "${SEARX_PYENV}/bin/python" "utils/searxng_check.py" - ;; all) rst_title "SearXNG (install)" part install_all ;; + check) + rst_title "SearXNG (check installation)" part + verify_continue_install + install_check + ;; user) rst_title "SearXNG (install user)" verify_continue_install @@ -352,6 +353,37 @@ install_all() { fi } +install_check() { + if service_account_is_available "$SERVICE_USER"; then + info_msg "Service account $SERVICE_USER exists." + else + err_msg "Service account $SERVICE_USER does not exists!" + fi + + if pyenv_is_available; then + info_msg "~$SERVICE_USER: python environment is available." + else + err_msg "~$SERVICE_USER: python environment is not available!" + fi + + if clone_is_available; then + info_msg "~$SERVICE_USER: SearXNG software is installed." + else + err_msg "~$SERVICE_USER: Missing SearXNG software!" + fi + + if uWSGI_app_enabled "$SEARXNG_UWSGI_APP"; then + info_msg "uWSGI app $SEARXNG_UWSGI_APP is enabled." + else + err_msg "uWSGI app $SEARXNG_UWSGI_APP not enabled!" + fi + + uWSGI_app_available "$SEARXNG_UWSGI_APP" \ + || err_msg "uWSGI app $SEARXNG_UWSGI_APP not available!" + + sudo -H -u "${SERVICE_USER}" "${SEARX_PYENV}/bin/python" "utils/searxng_check.py" +} + update_searx() { rst_title "Update SearXNG instance" @@ -851,33 +883,7 @@ sourced ${DOT_CONFIG} : EOF install_log_searx_instance - if service_account_is_available "$SERVICE_USER"; then - info_msg "Service account $SERVICE_USER exists." - else - err_msg "Service account $SERVICE_USER does not exists!" - fi - - if pyenv_is_available; then - info_msg "~$SERVICE_USER: python environment is available." - else - err_msg "~$SERVICE_USER: python environment is not available!" - fi - - if clone_is_available; then - info_msg "~$SERVICE_USER: SearXNG software is installed." - else - err_msg "~$SERVICE_USER: Missing SearXNG software!" - fi - - if uWSGI_app_enabled "$SEARXNG_UWSGI_APP"; then - info_msg "uWSGI app $SEARXNG_UWSGI_APP is enabled." - else - err_msg "uWSGI app $SEARXNG_UWSGI_APP not enabled!" - fi - - uWSGI_app_available "$SEARXNG_UWSGI_APP" \ - || err_msg "uWSGI app $SEARXNG_UWSGI_APP not available!" - + install_check if in_container; then lxc_suite_info else |