Skip to content

Instantly share code, notes, and snippets.

@Roadmaster
Created May 8, 2019 15:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Roadmaster/2567ad0273b42692623d259c4a286994 to your computer and use it in GitHub Desktop.
Save Roadmaster/2567ad0273b42692623d259c4a286994 to your computer and use it in GitHub Desktop.
#!/bin/bash
SNAP_NAME=lxd
info=$(curl -s https://api.snapcraft.io/v2/snaps/info/$SNAP_NAME -H "Snap-Device-Series: 16")
url=$(echo $info | jq -r '."channel-map"[0]."download"."url"')
snapid=$(echo $info | jq -r '."snap"."snap-id"')
# Download snap
echo "Downloading snap from $url"
#curl -LO $url
#Download assertion
echo "Downloading assertion"
curl -LO https://api.snapcraft.io/api/v1/snaps/assertions/snap-declaration/16/$snapid?max-format=3 -H "Content-Type: application/x-ubuntu-assertion"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment