Created
October 10, 2017 22:23
-
-
Save k4kfh/ccdfd9911e3af1653e2d3530f274994b to your computer and use it in GitHub Desktop.
Simple automatic download/checksum script for CyberPatriot.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
URL="http://example.com/file.img" | |
MASTER_CHECKSUM="d276d89cf506e3dc66ffb7550eec6223" | |
FILENAME=$(basename "$URL") | |
clear | |
wget $URL -O $FILENAME | |
LOCAL_CHECKSUM=`md5sum ${FILENAME} | awk '{ print $1 }'` | |
echo -e "\e[1mDownload process complete." | |
echo -e "\e[7mLocal checksum is $LOCAL_CHECKSUM" | |
echo -e "Correct checksum is $MASTER_CHECKSUM\e[0m" | |
if [ "$LOCAL_CHECKSUM" == "$MASTER_CHECKSUM" ] | |
then | |
echo -e "\e[7m\e[92mCHECKSUMS MATCH! IMAGE IS READY FOR EXTRACTION." | |
else | |
echo -e "\e[7m\e[91mCHECKSUMS DO NOT MATCH! PLEASE REDOWNLOAD!" | |
fi | |
echo -e "\e[0m" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment