#!/bin/bash # Script to calculate the checksum of a folders contents # When called with an SSI $FILEDIR should be defined and point to the folder containing the files # To Define a singular file FILE should be the filename # Copyright Ben Tasker # Released under GNU GPL # See http://benscomputer.no-ip.org/LICENSE for more information CURRENTDIR=$( pwd ) cd $FILEDIR if [ "$FILE" == "" ] then for a in *; do if [ -f "$a" ]; then # Is it a file echo \\ md5sum $a echo \\ fi done else echo \\ md5sum $FILE echo \\ fi cd $CURRENTDIR exit