#!/bin/sh

test -x /usr/sbin/logrotate || exit 0

EXIST=`ls -d1 /home1/_sites/*/log/apache 2> /dev/null | wc -l`
if [ $EXIST -eq 0 ]
then
  if [ -f /etc/logrotate.d/ipbrick ]
  then
    mv /etc/logrotate.d/ipbrick /etc/ipbrick.logrotate
  fi
else
  if [ -f /etc/ipbrick.logrotate ]
  then
    mv /etc/ipbrick.logrotate /etc/logrotate.d/ipbrick
  fi
fi

/usr/sbin/logrotate -f /etc/logrotate.conf
