Skip to content

Commit 6d8cee8

Browse files
authored
Make sure we have jq before relying on it during config (#2585)
1 parent de72498 commit 6d8cee8

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

ethd

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5271,14 +5271,19 @@ __query_mev_factor() {
52715271
return
52725272
fi
52735273

5274-
if [[ "${__cannot_sudo}" -eq 0 ]] && ! dpkg-query -W -f='${Status}' speedtest-cli 2>/dev/null | grep -q "ok installed"; then
5275-
echo "Installing speedtest-cli"
5276-
${__auto_sudo} apt-get update && ${__auto_sudo} apt-get install -y --no-install-recommends speedtest-cli
5277-
fi
5278-
if ! dpkg-query -W -f='${Status}' speedtest-cli 2>/dev/null | grep -q "ok installed"; then
5279-
echo "Cannot install \"speedtest-cli\", skipping MEV Build Factor query"
5280-
return
5274+
if ! dpkg-query -W -f='${Status}' speedtest-cli 2>/dev/null | grep -q "ok installed" || ! dpkg-query -W -f='${Status}' jq 2>/dev/null | grep -q "ok installed"; then
5275+
if [[ "${__cannot_sudo}" -eq 0 ]]; then
5276+
echo "Installing speedtest-cli and jq"
5277+
if ! { ${__auto_sudo} apt-get update && ${__auto_sudo} apt-get install -y --no-install-recommends speedtest-cli jq; }; then
5278+
echo "Cannot install speedtest-cli and jq, skipping MEV Build Factor query"
5279+
return
5280+
fi
5281+
else
5282+
echo "Cannot install speedtest-cli and jq, skipping MEV Build Factor query"
5283+
return
5284+
fi
52815285
fi
5286+
52825287
echo "Running speedtest"
52835288
set +e
52845289
speed_json=$(speedtest-cli --secure --json)

0 commit comments

Comments
 (0)