#! /bin/sh billperiod="$1" #billperiod="Jan_2011" OUTFILE="t21WBDL.unl" if [ -z "$billperiod" ]; then OUTDIR="." # get current config for dmz login eval `rptdates tm sfd | awk '{printf("SDATE=\"%s\"; EDATE=\"%s\"", $1, $2)}'` MMYYYY=`SDATEtoMMYYYY $SDATE` billperiod=`MMYYYYtobillperiod $MMYYYY _` echo "getting current t21WBDL.unl..." gett21WBDL "$SDATE" "$EDATE" STIME ETIME $SITEID "$OUTDIR/$OUTFILE" 2>&1 else # take from billperiod for auth OUTDIR="indata/$billperiod" echo "creating indata/billperiod..." ssh bilmax21@telmaxdmz "mkdir -p ex4/$OUTDIR" # set selinux file contexts echo "setting selinux context..." ssh bilmax21@telmaxdmz \ "chcon -h -t httpd_sys_content_t ex4/$OUTDIR" fi echo "copying t21WBDL.unl..." echo "scp \"$OUTDIR/$OUTFILE\" \"bilmax21@telmaxdmz:ex4/$OUTDIR\"" scp "$OUTDIR/$OUTFILE" "bilmax21@telmaxdmz:ex4/$OUTDIR" # set selinux file contexts echo "setting selinux context for t21WBDL.unl..." ssh bilmax21@telmaxdmz \ "cd ex4; chcon -h -t httpd_sys_content_t \"$OUTDIR/$OUTFILE\""