summarylogtreecommitdiffstats
path: root/snap-dlagent.sh
blob: 0c67c53e138e46e6a5c9336fb65703645b46beb7 (plain)
1
2
3
4
5
6
7
8
# An script to download from ModDB
url="${1}"
output="${2}"
resolved_url=$(curl -H 'Snap-Device-Series: 16' https://${url#snap://} | jq '."channel-map"' | jq '.[]' | jq '[."download"."url"]' | grep -m1 https | tr -d ' ' | tr -d '"')

echo "Downloading ${output}"
curl -L -C - "${resolved_url}" -o \
  "${output}"