#!/bin/bash
CONF_DIR="/etc/awstats"
CONF_EXT="conf"

if [ ! -d "$CONF_DIR" ]; then
  echo "$CONF_DIR does not exist"
  exit 1
else
  cd $CONF_DIR
fi

for cfg in *.$CONF_EXT; do
if [ "$cfg" != "awstats.model.conf" ]; then
   site=`echo $cfg|sed -e "s/awstats.//g" | sed -e "s/.conf//g"`
   ./addstat.sh $site
fi
done

