Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Query latest Ubiquiti USG firmware from command-line (depends: curl + jq)
#!/bin/bash
# Will output the latest firmware version and download URL for the Ubuqiti USG
# Depends on curl (https://curl.haxx.se/) and jq (https://stedolan.github.io/jq/)
curl -s 'https://www.ubnt.com/download/?group=usg' -H 'x-requested-with: XMLHttpRequest' | ./jq-osx-amd64 -c '[ .downloads[] | select(.category__slug=="firmware")] | max_by(.version) | {Version: .version, File: @text "https://dl.ubnt.com\(.file_path)" }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment