Navigate / search

How to verify your Apple support download files

If you have a computer running Mac OS X, chances are you have downloaded files from the Apple support web site. You can actually verify the integrity of these support files using a simple script.

You have two options on how to update your Mac OS X. The first option is using the Software Update program accessible via the Apple icon. The second option is by downloading the updates via the Apple Support download site. I have actually resorted to the second option a number of times because of errors I get using the Software Update program.

If you look at the download page of Apple’s support (sample below), you’ll notice that there’s this line that says “SHA1 …”. SHA1 is string of alphanumeric characters that you can actually use to verify the integrity or correctness of the installable update file.

I’ve created a small script to make it easier to verify it so that I don’t have to manually look at the string and compare it with what I get on my Mac. You can copy and paste the script below and save it to a file called “sha1-verify.sh”.

#!/bin/bash
fname=$1
sha1=$2
computed=`openssl sha1 ${fname} |awk '{print $2}'`
echo File: ${fname}
echo Computed SHA1: ${computed}
echo Pre-computed SHA1: ${sha1}
if [[ ${computed} == ${sha1} ]]
then
   echo SHA1 of ${fname} SUCCESSFULLY verified
else
   echo SHA1 of ${fname} FAILED verification process
fi

To use the program, just open a terminal window on your Mac and run it. The script command line syntax is:

sha1-verify.sh filename sha1-value

Where:

  • filename = the name of the file that you downloaded and saved on your Mac
  • sha1-value = the SHA1 string that is found on the Apple support page for the file that you downloaded

Gerry Ilagan

Gerry Ilagan is into mobile apps and WordPress development at @speeqs. He loves to write about electronics, the Internet of Things, mobile phones, and #crazyideas.

Comments

Savy
Reply

There is a simple application “Checksums calculator” a GUI tool to calculate md5, sha1, sha256, sha384, sha512 witch can run under Linux, Windows and MacOS x operating systems on both 32 and 64bit architectures. For more info take a look here: http://www.sinf.gr/en/hashcalc.html

Leave a comment

name*

email* (not published)

website