Skip to content

Instantly share code, notes, and snippets.

@jim80net
Created February 27, 2014 16:38
Show Gist options
  • Save jim80net/9253786 to your computer and use it in GitHub Desktop.
Save jim80net/9253786 to your computer and use it in GitHub Desktop.
BASH checksum
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
CHECKSUM=`cat $DIR/.syncme.sh.md5sum | awk '{print $1}'`
MYCHECKSUM=`md5sum $DIR/syncme.sh | awk '{print $1}'`
if [[ "$CHECKSUM" != "$MYCHECKSUM" ]]
then
echo "This script was modified."
exit 2
else
exit 0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment