#!/usr/bin/env bash # SPDX-License-Identifier: AGPL-3.0-or-later # shellcheck disable=SC2001 # shellcheck source=utils/lib.sh source "$(dirname "${BASH_SOURCE[0]}")/lib.sh" # ---------------------------------------------------------------------------- # config # ---------------------------------------------------------------------------- PUBLIC_URL="${PUBLIC_URL:-${SEARXNG_URL}}" FILTRON_ETC="/etc/filtron" SERVICE_NAME="filtron" SERVICE_USER="${SERVICE_USER:-${SERVICE_NAME}}" SERVICE_SYSTEMD_UNIT="${SYSTEMD_UNITS}/${SERVICE_NAME}.service" APACHE_FILTRON_SITE="searx.conf" NGINX_FILTRON_SITE="searx.conf" # ---------------------------------------------------------------------------- usage() { # ---------------------------------------------------------------------------- # shellcheck disable=SC1117 cat <&1 | prefix_stdout if service_is_available "${PUBLIC_URL}"; then MSG="** Don't forget to remove your public site! (${PUBLIC_URL}) **" wait_key 10 fi } remove_apache_site() { rst_title "Remove Apache site $APACHE_FILTRON_SITE" rst_para "\ This removes apache site ${APACHE_FILTRON_SITE}." ! apache_is_installed && err_msg "Apache is not installed." if ! ask_yn "Do you really want to continue?" Yn; then return fi apache_remove_site "$APACHE_FILTRON_SITE" } remove_nginx_site() { rst_title "Remove nginx site $NGINX_FILTRON_SITE" rst_para "\ This removes nginx site ${NGINX_FILTRON_SITE}." ! nginx_is_installed && err_msg "nginx is not installed." if ! ask_yn "Do you really want to continue?" Yn; then return fi nginx_remove_app "$FILTRON_FILTRON_SITE" } # ---------------------------------------------------------------------------- main "$@" # ----------------------------------------------------------------------------