#!/bin/sh if [ -z $2 ]; then echo "Usage: $0 authentic_file file_for_check"; exit if md5sum $1 | cut -c1-32 > /tmp/f1.cksum md5sum $2 | cut -c1-32 > /tmp/f2.cksum sha1sum $1 | cut -c1-40 >> /tmp/f1.cksum sha1sum $2 | cut -c1-40 >> /tmp/f2.cksum res=`/usr/bin/cmp /tmp/f1.cksum /tmp/f2.cksum` if [ -z "$res" ]; then echo "File is authentic" else echo "File is not authentic" fi rm /tmp/f1.cksum /tmp/f2.cksum