Last active
February 3, 2018 09:05
-
-
Save 111a5ab1/dae24a83bda3917cf07155a9a433a5d2 to your computer and use it in GitHub Desktop.
Query latest Ubiquiti USG firmware from command-line (depends: curl + jq)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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