Instantly share code, notes, and snippets.

Embed
What would you like to do?
Raspberry Pi download hash-check
#!/bin/bash
cd ~/Downloads
wget https://downloads.raspberrypi.org/raspbian_full_latest -O raspi.zip
sha1=$(shasum -a 256 raspi.zip | grep -o -P "[0-9a-z]{40,}")
sha2=$(curl https://www.raspberrypi.org/downloads/raspbian/ | grep -o -P "[0-9a-z]{40,}" | head -1)
sleep 10
echo Prüfsumme aus Download $sha1
echo Prüfsumme von Webseite $sha2
if [ $sha1 == $sha2 ]; then
echo "Prüfsumme stimmt "
else
echo "Achtung,Prüfsumme stimmt nicht überein !"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment