[fix] make test.sh: fix various shellcheck error messages

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2020-03-30 11:03:46 +02:00
parent 5e2b161379
commit 3e4d022d04
5 changed files with 12 additions and 6 deletions

View file

@ -219,6 +219,7 @@ test.pylint: pyenvinstall
# ubu1604: uses shellcheck v0.3.7 (from 04/2015), no longer supported! # ubu1604: uses shellcheck v0.3.7 (from 04/2015), no longer supported!
test.sh: test.sh:
shellcheck -x -s bash utils/brand.env
shellcheck -x utils/lib.sh shellcheck -x utils/lib.sh
shellcheck -x utils/filtron.sh shellcheck -x utils/filtron.sh
shellcheck -x utils/searx.sh shellcheck -x utils/searx.sh

View file

@ -1079,6 +1079,7 @@ in_container() {
LXC_ENV_FOLDER= LXC_ENV_FOLDER=
if in_container; then if in_container; then
# shellcheck disable=SC2034
LXC_ENV_FOLDER="lxc/$(hostname)/" LXC_ENV_FOLDER="lxc/$(hostname)/"
fi fi

View file

@ -32,11 +32,13 @@ lxc_set_suite_env() {
export MORTY_LISTEN="0.0.0.0:3000" export MORTY_LISTEN="0.0.0.0:3000"
} }
lxc_suite_install_info="suite includes searx, morty & filtron" # shellcheck disable=SC2034
LXC_SUITE_INSTALL_INFO="suite includes searx, morty & filtron"
lxc_suite_install() { lxc_suite_install() {
( (
lxc_set_suite_env lxc_set_suite_env
export FORCE_TIMEOUT=0 FORCE_TIMEOUT=0
export FORCE_TIMEOUT
"${LXC_REPO_ROOT}/utils/searx.sh" install all "${LXC_REPO_ROOT}/utils/searx.sh" install all
"${LXC_REPO_ROOT}/utils/morty.sh" install all "${LXC_REPO_ROOT}/utils/morty.sh" install all
"${LXC_REPO_ROOT}/utils/filtron.sh" install all "${LXC_REPO_ROOT}/utils/filtron.sh" install all
@ -50,7 +52,8 @@ lxc_suite_install() {
lxc_suite_prepare_buildhost() { lxc_suite_prepare_buildhost() {
( (
lxc_set_suite_env lxc_set_suite_env
export FORCE_TIMEOUT=0 FORCE_TIMEOUT=0
export FORCE_TIMEOUT
# "${LXC_REPO_ROOT}/utils/searx.sh* install packages # "${LXC_REPO_ROOT}/utils/searx.sh* install packages
"${LXC_REPO_ROOT}/utils/searx.sh" install buildhost "${LXC_REPO_ROOT}/utils/searx.sh" install buildhost
rst_title "buildhost installation finished ($(hostname))" part rst_title "buildhost installation finished ($(hostname))" part

View file

@ -104,7 +104,7 @@ cmd
-- run command '...' in all containers of the LXC suite -- run command '...' in all containers of the LXC suite
:<name>: run command '...' in container <name> :<name>: run command '...' in container <name>
install install
:suite: install LXC suite; ${lxc_suite_install_info} :suite: install LXC suite; ${LXC_SUITE_INSTALL_INFO}
:base: prepare LXC; install basic packages :base: prepare LXC; install basic packages
:buildhost: prepare LXC; install buildhost packages :buildhost: prepare LXC; install buildhost packages
@ -241,13 +241,14 @@ main() {
sudo_or_exit sudo_or_exit
case $2 in case $2 in
suite|base|buildhost) suite|base|buildhost)
lxc_exec "${LXC_REPO_ROOT}/utils/lxc.sh" __install $2 lxc_exec "${LXC_REPO_ROOT}/utils/lxc.sh" __install "$2"
;; ;;
*) usage "$_usage"; exit 42 ;; *) usage "$_usage"; exit 42 ;;
esac esac
;; ;;
__install) __install)
# wrapped install commands, called once in each container # wrapped install commands, called once in each container
# shellcheck disable=SC2119
case $2 in case $2 in
suite) lxc_suite_install ;; suite) lxc_suite_install ;;
base) FORCE_TIMEOUT=0 lxc_install_base_packages ;; base) FORCE_TIMEOUT=0 lxc_install_base_packages ;;

View file

@ -16,7 +16,7 @@ in_container && lxc_set_suite_env
PUBLIC_URL="${PUBLIC_URL:-http://$(uname -n)/searx}" PUBLIC_URL="${PUBLIC_URL:-http://$(uname -n)/searx}"
PUBLIC_URL_PATH_MORTY="${PUBLIC_URL_PATH_MORTY:-/morty}" PUBLIC_URL_PATH_MORTY="${PUBLIC_URL_PATH_MORTY:-/morty}"
PUBLIC_URL_MORTY="$(echo $PUBLIC_URL | sed -e's,^\(.*://[^/]*\).*,\1,g')${PUBLIC_URL_PATH_MORTY}" PUBLIC_URL_MORTY="$(echo "$PUBLIC_URL" | sed -e's,^\(.*://[^/]*\).*,\1,g')${PUBLIC_URL_PATH_MORTY}"
MORTY_LISTEN="${MORTY_LISTEN:-127.0.0.1:3000}" MORTY_LISTEN="${MORTY_LISTEN:-127.0.0.1:3000}"
# shellcheck disable=SC2034 # shellcheck disable=SC2034