1#!/bin/bash 2# 3# Copyright (c) International Business Machines Corp., 2005 4# Author: Avantika Mathur (mathurav@us.ibm.com) 5# 6# This library is free software; you can redistribute it and/or 7# modify it under the terms of the GNU Lesser General Public 8# License as published by the Free Software Foundation; either 9# version 2.1 of the License, or (at your option) any later version. 10# 11# This library is distributed in the hope that it will be useful, 12# but WITHOUT ANY WARRANTY; without even the implied warranty of 13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14# Lesser General Public License for more details. 15# 16# You should have received a copy of the GNU Lesser General Public 17# License along with this library; if not, write to the Free Software 18# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19# 20 21reverse=0 22while getopts "n" args $OPTIONS 23do 24 case "$args" in 25 n) reverse=1 26 shift 27 ;; 28 esac 29done 30 31if [ $reverse -eq 1 ] 32then 33 echo Check No Propagation $* 34else 35 echo Check Propagation $* 36fi 37 38dir1="$1" 39shift 40 41for dir2 in "$@" 42do 43 # compare adjacent pairs of directory trees 44 45 echo "Checking \"$dir1\" \"$dir2\"" 46 diff -r "$dir1" "$dir2" 2> /dev/null 47 48 if [ $? -ne 0 ] 49 then 50 if [ $reverse -eq 1 ] 51 then 52 echo Successful 53 echo "---------" 54 exit 0 55 else 56 echo "FAILED" 57 echo "---------" 58 exit 1 59 fi 60 fi 61 dir1="$dir2" 62done 63 64if [ $reverse -eq 1 ] 65then 66 echo FAILED 67 echo "---------" 68 exit -1 69else 70 echo Successful 71 echo "---------" 72 exit 0 73fi 74