Skip to content

Instantly share code, notes, and snippets.

@ivanpu
Last active August 11, 2017 21:26
Show Gist options
  • Save ivanpu/4e687de3fcb5cc28e6c3 to your computer and use it in GitHub Desktop.
Save ivanpu/4e687de3fcb5cc28e6c3 to your computer and use it in GitHub Desktop.
RuneScape repo update checker
#!/bin/bash
# Note: the following key must be added beforehand to your keyring:
# https://content.runescape.com/downloads/ubuntu/runescape.gpg.key
set -e
# settings - editable
dist=trusty
repo="https://content.runescape.com/downloads/ubuntu/dists/$dist"
pkgs="non-free/binary-amd64/Packages.gz"
echo $'\n\033[1m==> Downloading: Release\033[0m'
wget -O Release "$repo/Release"
wget -O Release.gpg "$repo/Release.gpg"
gpg --verify Release.gpg Release
echo $'\n\033[1m==> Downloading: Packages\033[0m'
wget -O Packages.gz "$repo/non-free/binary-amd64/Packages.gz"
grep $(sha256sum Packages.gz | sed 's/ .*//') Release
rm -f Packages
gunzip Packages.gz
grep $(sha256sum Packages | sed 's/ .*//') Release
echo $'\n\033[1m*** Latest packages ***\033[0m'
grep '^\(Package\|Version\|SHA256\):' Packages
@sovietspy2
Copy link

hey! What does set -e do?

@p-baum
Copy link

p-baum commented Aug 11, 2017

set -e stops running the script if it hits an error

How exactly does one add https://content.runescape.com/downloads/ubuntu/runescape.gpg.key to ones "keyring"?

@p-baum
Copy link

p-baum commented Aug 11, 2017

download and run gpg --import runescape.gpg.key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment