[PLUG] Logs and Reporting ... Again

Rich Shepard rshepard at appl-ecosys.com
Wed Mar 25 14:00:12 UTC 2009


On Tue, 24 Mar 2009, Roderick A. Anderson wrote:

> 1. Does 1pflogsumm do the same as your command line below? (copy and
> paste from the file to be sure).

Rod,

   I just tried to run /etc/cron.daily/1pflogsumm by copying each line to
another virtual console logged in as root. Each line was excepted until the
long perl statement. The full statement, followed by the result, follows:

perl -e 'use Date::Calc;' 2>/dev/null || {
     sed -e '/# ---Begin:/,/# ---End:/d' < ${EXECUTABLE} >
${TMPDIR}/${TMPEXE}
     chmod u=rx,go= ${TMPDIR}/${TMPEXE} || echo "$0: warning - unable to set
permissions on ${TMPDIR}/${TMPEXE}"
     EXECUTABLE=${TMPDIR}/${TMPEXE}
}

> > sed -e '/# ---Begin:/,/# ---End:/d' < ${EXECUTABLE} >
${TMPDIR}/${TMPEXE}
> > chmod u=rx,go= ${TMPDIR}/${TMPEXE} || echo "$0: warning - unable to set
permissions on ${TMPDIR}/${TMPEXE}"
> EXECUTABLE=${TMPDIR}/${TMPEXE}
> }
-bash: ${EXECUTABLE}: ambiguous redirect
-bash: /: is a directory
-bash: warning - unable to set permissions on /

   This suggests to me that the forward slash used to indicate the
directory/executable file path is seen as the root directory. The line
assigning values to $EXECUTABLE and $TMPDIR string were accepted by bash:

EXECUTABLE=/usr/local/bin/pflogsumm
TMPDIR=/etc/postfix

and was accepted a few lines further in the script:

trap "test -r ${TMPDIR}/${TMPEXE} && rm -f ${TMPDIR}/${TMPEXE}" 0 1 2 3 15

   Does this help to identify what I should do to fix the script so it once
again runs?

Thanks,

Rich




More information about the PLUG mailing list