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.
This commit is contained in:
2024-09-16 20:19:25 -07:00
parent c8177a0736
commit 7c46719ab1

View File

@@ -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