Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
redream latest url
#!/bin/bash
get_latest_url() {
local REDREAM_URL=https://redream.io
local REDREAM_TARGET=aarch32-raspberry-linux
wget -qO /tmp/redream-download.html ${REDREAM_URL}/download
local links=$( \
grep -E 'href="([^"]*redream.'$REDREAM_TARGET'[^"]+)' /tmp/redream-download.html | \
sed -E 's/.*href="([^"]*redream.'$REDREAM_TARGET'[^"]+)".*/\1/g' | \
uniq \
)
rm /tmp/redream-download.html
local latest=$(echo "$links" | head -n1)
echo ${REDREAM_URL}${latest}
}
LATEST_URL=$(get_latest_url)
echo $LATEST_URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment