Merge pull request #41 from SkeletonMan03/main

Add SHA256 Hash check to ensure that Medicat 7z is good
This commit is contained in:
Matthew Clark 2023-07-21 23:01:18 -05:00 committed by GitHub
commit 0a028004f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,8 @@ echo -e "WELCOME TO THE MEDICAT INSTALLER, PLEASE DO NOT RUN THIS AS ROOT\nThis
echo "Updated for efficiency and cross-distro use by SkeletonMan" echo "Updated for efficiency and cross-distro use by SkeletonMan"
echo "Waiting for 10 seconds" echo "Waiting for 10 seconds"
sleep 10 sleep 10
if grep -qs "ubuntu" /etc/os-release; then if grep -qs "ubuntu" /etc/os-release; then
os="ubuntu" os="ubuntu"
pkgmgr="apt" pkgmgr="apt"
@ -66,15 +68,16 @@ tar -xf ventoy.tar.gz
rm -rf ventoy.tar.gz ./ventoy/ventoy-${venver: -6} rm -rf ventoy.tar.gz ./ventoy/ventoy-${venver: -6}
mv ventoy-${venver: -6} ventoy mv ventoy-${venver: -6} ventoy
echo -e "\n\n\n\n\n\n" echo -e "\n\n\n\n\n\n"
sha256hash='a306331453897d2b20644ca9334bb0015b126b8647cecec8d9b2d300a0027ea4'
if [[ -f MediCat.USB.v21.12.7z ]]; then if [[ -f MediCat.USB.v21.12.7z ]]; then
location='MediCat.USB.v21.12.7z' location='MediCat.USB.v21.12.7z'
fi fi
if ! [[ -f MediCat.USB.v21.12.7z ]]; then if ! [[ -f MediCat.USB.v21.12.7z ]]; then
if [[ -f MediCat\ USB\ v21.12/MediCat.USB.v21.12.7z ]]; then if [[ -f MediCat\ USB\ v21.12/MediCat.USB.v21.12.7z ]]; then
location=''MediCat\ USB\ v21.12/MediCat.USB.v21.12.7z'' location=''MediCat\ USB\ v21.12/MediCat.USB.v21.12.7z''
else else
echo "Please enter location of MediCat.USB.v21.12.7z if it exists or just press enter to download it via tor." echo "Please enter location of MediCat.USB.v21.12.7z if it exists or just press enter to download it via torrent."
read location read location
fi fi
if [ -z "$location" ] ; then if [ -z "$location" ] ; then
echo "Starting to download torrent" echo "Starting to download torrent"
@ -83,6 +86,21 @@ if ! [[ -f MediCat.USB.v21.12.7z ]]; then
location=''MediCat\ USB\ v21.12/MediCat.USB.v21.12.7z'' location=''MediCat\ USB\ v21.12/MediCat.USB.v21.12.7z''
fi fi
fi fi
echo -e "Checking Sha256 hash of MediCat.USB.v21.12.7z.."
checksha256=$(sha256sum MediCat.USB.v21.12.7z | awk '{print $1}')
if [[ checksha256 -ne $sha256hash ]]; then
echo -e "Your MediCat.USB.v21.12.7z SHA256 hash does not match!!!"
echo -e "Hash is $checksha256"
echo -e "Exiting for your safety!"
exit
else
echo -e "Your MediCat.USB.v21.12.7z sha256 hash matches!"
echo -e "Hash is $checksha256"
echo -e "We are safe to proceed"
fi
echo -e "\n\n\n" echo -e "\n\n\n"
echo "Please Plug your USB in now if it is not already" echo "Please Plug your USB in now if it is not already"
echo "Waiting 15 seconds..." echo "Waiting 15 seconds..."