mirror of
https://github.com/redlib-org/redlib-instances.git
synced 2024-11-13 18:06:15 -05:00
lazily check if onion or i2p sites exist in instances.json before running jq.
This commit is contained in:
parent
f19da6ca8d
commit
dfba0f285b
@ -728,8 +728,12 @@ main ()
|
||||
# (a mapfile would not ideal here since a pipe is required, inducing a
|
||||
# subshell, meaning nothing will actually get added to
|
||||
# imported_nonwww)
|
||||
if grep -q ".onion" "${import_nonwww_from_file}" || grep -q ".i2p" "${import_nonwww_from_file}" ; then
|
||||
IFS=$'\n' imported_nonwww=($(jq -Mcer '.instances[] | select(.onion or .i2p)' "${import_nonwww_from_file}"))
|
||||
rc=$?
|
||||
else
|
||||
rc=0
|
||||
fi
|
||||
|
||||
if [[ ${rc} -ne 0 ]]
|
||||
then
|
||||
|
Loading…
Reference in New Issue
Block a user