#!/bin/sh
CONF=$(dirname $0)/mirror.conf

if [ -f $CONF ] ; then
  . $CONF
fi

for i in $EXCLUDE ; do
  j=`echo $i | sed "s/\.\*//g"`
  # find kann nix mit '/' anfangen ...
  if ! echo "$j" | grep -q '/'  ; then
    find $destdir -name "*$j*" -exec rm -fr \{\} \;
  else
    jx=`echo "$j" | sed -e 's#^/##' -e 's#/$##'`
    echo $jx
    if ! echo "$x" | grep -q '/'  ; then
      find $destdir -name "*$jx*" -exec rm -fr \{\} \;
    fi
  fi
done
