From 7c46719ab1769e9cf5396ccbc4bc44f9a8046f0b Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Mon, 16 Sep 2024 20:19:25 -0700 Subject: [PATCH] container: finance: lib_fetch: fix Tor plugin (proxychains) check This ensures that curl will only be executed if the Tor plugin (proxychains) argument is enabled. --- container/src/finance/lib/internal/lib_fetch.bash | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/container/src/finance/lib/internal/lib_fetch.bash b/container/src/finance/lib/internal/lib_fetch.bash index 06a7a49..0a8fa88 100644 --- a/container/src/finance/lib/internal/lib_fetch.bash +++ b/container/src/finance/lib/internal/lib_fetch.bash @@ -834,8 +834,10 @@ function lib_fetch::__fetch_exec() [[ "$global_arg_tor" =~ ^on$|^true$ ]] && _exec+=("proxychains") # Wrap with proxychains # Test for Tor plugin - if ! "${_exec[@]}" curl -s "https://check.torproject.org" &>/dev/null; then - lib_utils::die_fatal "Tor plugin not started (or needs restart)" + if [ ! -z "${_exec[*]}" ]; then + if ! "${_exec[@]}" curl -s "https://check.torproject.org" &>/dev/null; then + lib_utils::die_fatal "Tor plugin not started (or needs restart)" + fi fi # TODO: remove no-limit after internal fetching writes per-paginated instead of per-fetch