1 #!/bin/bash 2 # 3 # Copyright (c) International Business Machines Corp., 2005 4 # Author: Avantika Mathur (mathurav (at] 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 21 reverse=0 22 while getopts "n" args $OPTIONS 23 do 24 case "$args" in 25 n) reverse=1 26 shift 27 ;; 28 esac 29 done 30 31 if [ $reverse -eq 1 ] 32 then 33 echo Check No Propagation $* 34 else 35 echo Check Propagation $* 36 fi 37 38 dir1="$1" 39 shift 40 41 for dir2 in "$@" 42 do 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" 62 done 63 64 if [ $reverse -eq 1 ] 65 then 66 echo FAILED 67 echo "---------" 68 exit -1 69 else 70 echo Successful 71 echo "---------" 72 exit 0 73 fi 74