Skip to content

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"
echo "Raspberry Pi Image wird entpackt."
unzip raspi.zip
else
echo "Achtung,Prüfsumme stimmt nicht überein !"
fi
@dewomser

This comment has been minimized.

Copy link
Owner Author

dewomser commented Feb 19, 2019

Download Raspberry-Pi-image
Prüfe SHA Hash
Bei Erfolg entpacken

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.