: !/bin/sh ######################################################################## # T21BATCHNAME traffic1.t21batch # T21BATCHDESC Route Histogram Reports # ALLOWBLANKDATES false # CUSTOMDESC Email Address # CUSTOMDEF `cat /u/catcom/database/reports.emaillist` # T21BATCHVAR1DESC # T21BATCHVAR1VALU # T21BATCHVAR2DESC # T21BATCHVAR2VALU # T21BATCHVAR3DESC # T21BATCHVAR3VALU # T21BATCHVAR4DESC # T21BATCHVAR4VALU # T21BATCHVAR5DESC # T21BATCHVAR5VALU # T21BATCHENDARGS ######################################################################## # command line args SDATE=$1; EDATE=$2; STIME=$3; ETIME=$4 SITEID="$5" CUSTPARAM="$6" SITE_ROUTE_LIST_FILE="/u/catcom/database/traffic1_list" ########################################################################### lastdayinmonth() # Returns the last day in month, Inputs: $1=mm $2=yyyy { cal $1 $2 | awk '{ if ( NF > 0 ) x=$NF } END { print x }' } ################################################################# # MAIN umask 0 ################################################################# if [ -z "$SITEID" ]; then echo "Enter siteid (Enter for ALL):\c"; read SITEID fi if [ -z "$SDATE" ]; then echo "Enter start date:\c"; read SDATE fi if [ -z "$EDATE" ]; then echo "Enter end date:\c"; read EDATE fi if [ -z "$STIME" ]; then echo "Enter start time:\c"; read STIME fi if [ -z "$ETIME" ]; then echo "Enter end time:\c"; read ETIME fi if [ -z "$CUSTPARAM" ]; then echo "Enter Email Address:\c"; read CUSTPARAM fi ########################################################################### if [ "$SITEID" = "" ]; then SITEID="ALL" fi if [ -n "$CUSTPARAM" ]; then EMAIL_ADDRESS="$CUSTPARAM" else EMAIL_ADDRESS="$LOGNAME" fi ########################################################################### # temp TMPRTAG="traffic1_" tmpfile=/tmp/${TMPRTAG}$$ rm -f $tmpfile ########################################################################### ########################################################################### # send script output output to file exec >$tmpfile 2>&1 ########################################################################### echo "Starting $0: $SDATE $EDATE - " `date` echo " EMAIL_ADDRESS=[$EMAIL_ADDRESS]" echo " SITE_ROUTE_LIST_FILE=[$SITE_ROUTE_LIST_FILE]" ######################################################################## ########################################################################### # prepare for report output setting to be controlled within this script # disable rpt options set if spooled if [ "$spoolt21rptopts" = "1" ]; then spoolt21rptopts=0 export spoolt21rptopts runont21_pid=$rptque_pid fi # make sure runont21_pid is set for srct21rptopts script to find temp rpt opts if [ -z "$runont21_pid" ]; then runont21_pid="$$" fi export runont21_pid # must be set so pr_rep sets uue_pid dobatch_pid=$runont21_pid; export dobatch_pid # set pr_rep env file name for concat/email ALL-IN-ONE if [ -z "$pr_rep_env_file" ]; then pr_rep_env_file="$HOME/pr_rep.env$runont21_pid" export pr_rep_env_file fi ########################################################################### ########################################################################### ########################################################################### ########################################################################### # setup report output options to be # DOS text, emailed as single (concatinated) rtf attchment RPTOPTSTEMP="tmp/.t21rptopts.tmp$runont21_pid" cat > $HOME/$RPTOPTSTEMP < $HOME/$RPTOPTSTEMP <