Unverified Commit eaf47e2f authored by Yechiel Worenklein's avatar Yechiel Worenklein
Browse files

burpsuite: fix update script to avoid downgrades

parent 4db0f100
Loading
Loading
Loading
Loading
+10 −11
Original line number Diff line number Diff line
@@ -4,17 +4,16 @@ set -eu -o pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"

curl -s 'https://portswigger.net/burp/releases/data' |
  jq -r '
      [[
        .ResultSet.Results[]
        | select(
            (.categories | sort) == (["Professional","Community"] | sort)
            and .releaseChannels == ["Early Adopter"]
          )
      ][0].builds[]
curl -s 'https://portswigger.net/burp/releases/data' | jq -r '
      def verarr: (.Version // "") | split(".") | map(tonumber? // 0);
      [ .ResultSet.Results[]
        | select((.categories|sort) == (["Professional","Community"]|sort))
        | .builds[]
        | select(.ProductPlatform == "Jar")
    ]' >latest.json
      ] as $all
      | ($all | max_by( (.Version // "") | split(".") | map(tonumber? // 0) ) | .Version) as $v
      | $all | map(select(.Version == $v))
      ' > latest.json

version=$(jq -r '.[0].Version' latest.json)