#!/bin/sh
#-------------------------------------------------------------------------
# @(#) dda-update - Update the dda statistics
#
# 02-05-1995, TB   First version
#-------------------------------------------------------------------------

#-------------------------------------------------------------------------
# Globals
#-------------------------------------------------------------------------
VERSION="1.0 05/02/95"
PROG="`basename $0`"

# The programs
CP="/bin/cp"
DDA="/usr/local/sbin/dda"
RM="/bin/rm"

# The files
DD_LOGFILE="/usr/adm/dialdlog"
DD_TEMPFILE="/tmp/dialdlog"
DD_STATFILE="/usr/adm/dda.stats"

#-------------------------------------------------------------------------
# Functions
#-------------------------------------------------------------------------

#-------------------------------------------------------------------------
# The main body
#-------------------------------------------------------------------------
# Main

# Get the current dialdlog and empty it
${CP} ${DD_LOGFILE} ${DD_TEMPFILE}
> ${DD_LOGFILE}

# Process the dialdlog file
${DDA} -ul ${DD_TEMPFILE} -f ${DD_STATFILE}
${RM} ${DD_TEMPFILE}

# Show the current month
MONTH="`date +%h`"
${DDA} -m ${MONTH} -f ${DD_STATFILE}

# End of the shell script
exit 0
