- done
-done
-
-for z in `seq $MINZ $MAXZ`
-do
- if [ ! -d "${OSMORGDIR}${z}" ] ; then
- continue
- fi
- for tiles in `find ${OSMORGDIR}${z} -xdev -type f -name '*.meta' -size ${SIZEOSMORG}c -mtime +${AGE} -print`
- do
- # We need to skip the first 20 bytes of the file as they contain the metafile
- # header that contains the x/y location of the tile.
- TILEMD5=`tail -c +20 $tiles | md5sum -b | sed -e 's/ .*//g'`
- if [ "$TILEMD5" == "$MD5OSMORG" ] ; then
- echo "Deleting $tiles"
- #rm $tiles
- if [ $? -ne 0 ] ; then
- echo "There was an error deleting $tiles."
- echo "Aborting after deleting $NDELETED files."
- exit 1
+ for tiles in `find ${TDIR[$style]}${z} -xdev -type f -name '*.meta' -size ${TSIZE[$style]}c -mtime +${AGE} -print`
+ do
+ # We need to skip the first 20 bytes of the file as they contain the metafile
+ # header that contains the x/y location of the tile.
+ TILEMD5=`tail -c +20 $tiles | md5sum -b | sed -e 's/ .*//g'`
+ if [ "$TILEMD5" == "${TMD5[$style]}" ] ; then
+ echo "Deleting $tiles"
+ rm $tiles
+ if [ $? -ne 0 ] ; then
+ echo "There was an error deleting $tiles."
+ echo "Aborting after deleting $NDELETED files."
+ exit 1
+ fi
+ let "NDELETED=NDELETED+1"
+ #else
+ # echo "$tiles is not a water tile."