#!/bin/bash
#
#	There's probably a better way to do this, but this works so I'll
#	probably never change it.
#

WULOGDIR='UNKNOWN'
STATDIR='UNKNOWN'

cd ${STATDIR}

./ftpstat daily

if [ -e ftplog13.stor ]
then
  rm -f ftplog13.stor
fi
if [ -e ftplog12.stor ]
then
  mv -f ftplog12.stor ftplog13.stor
fi
if [ -e ftplog11.stor ]
then
  mv -f ftplog11.stor ftplog12.stor
fi
if [ -e ftplog10.stor ]
then
  mv -f ftplog10.stor ftplog11.stor
fi
if [ -e ftplog9.stor ]
then
  mv -f ftplog9.stor ftplog10.stor
fi
if [ -e ftplog8.stor ]
then
  mv -f ftplog8.stor ftplog9.stor
fi
if [ -e ftplog7.stor ]
then
  mv -f ftplog7.stor ftplog8.stor
fi
if [ -e ftplog6.stor ]
then
  mv -f ftplog6.stor ftplog7.stor
fi
if [ -e ftplog5.stor ]
then
  mv -f ftplog5.stor ftplog6.stor
fi
if [ -e ftplog4.stor ]
then
  mv -f ftplog4.stor ftplog5.stor
fi
if [ -e ftplog3.stor ]
then
  mv -f ftplog3.stor ftplog4.stor
fi
if [ -e ftplog2.stor ]
then
  mv -f ftplog2.stor ftplog3.stor
fi
if [ -e ftplog1.stor ]
then
  mv -f ftplog1.stor ftplog2.stor
fi
if [ -e ftplog0.stor ]
then
  mv -f ftplog0.stor ftplog1.stor
fi

cd ${WULOGDIR}

if [ -e xferlog9 ]
then
  rm -f xferlog9
fi
if [ -e xferlog8 ]
then
  mv -f xferlog8 xferlog9
fi
if [ -e xferlog7 ]
then
  mv -f xferlog7 xferlog8
fi
if [ -e xferlog6 ]
then
  mv -f xferlog6 xferlog7
fi
if [ -e xferlog5 ]
then
  mv -f xferlog5 xferlog6
fi
if [ -e xferlog4 ]
then
  mv -f xferlog4 xferlog5
fi
if [ -e xferlog3 ]
then
  mv -f xferlog3 xferlog4
fi
if [ -e xferlog2 ]
then
  mv -f xferlog2 xferlog3
fi
if [ -e xferlog1 ]
then
  mv -f xferlog1 xferlog2
fi
if [ -e xferlog0 ]
then
  mv -f xferlog0 xferlog1
fi
if [ -e xferlog ]
then
  mv -f xferlog xferlog0
fi

touch xferlog
chmod 0644 xferlog

exit
