This one time, at band camp, Paolo said: > hello, > > I couldn't find a way to tell the script how freshclam failed, ie it's > Return Code, other than doing a rough 'tail -15 $UpdateLogFile|mail -s...'. > So, If not already there, and I just missed it, I'd like a way to do eg. > > OnErrorExecute /etc/clamav/onerrorexecute.d/err-dbvirus.sh %rc > > where %rc would be the failure Return Code as doc'd in freshclam(1), > and in err-dbvirus.sh perhaps something like > > ... > case $1 in > 40) emsg="Unknown option passed" ;; > 50) emsg="Can't change directory" ;; > ... > esac > ... > echo |mail -s "FRESHCLAM:$HOSTNAME: $emsg" root > > for sysadmins low in memory ;).
You are correct, there is no current way - right now it just uses c's system() to execute the command line as is, and does no expansion of parameters. However, your line above works around this nicely, I think. I personally feel fairly low priority about this right now (my plate is rather full at the moment, sorry), but it would be pretty easy to code up a patch based on virusaction() in clamd/others.c if you are interested. If it is worth it to you to do so, I will definitely send it upstream for inclusion. Thanks for the report, and sorry I am not more responsive at the moment about this, -- ----------------------------------------------------------------- | ,''`. Stephen Gran | | : :' : [EMAIL PROTECTED] | | `. `' Debian user, admin, and developer | | `- http://www.debian.org | -----------------------------------------------------------------
pgpRGladQGorM.pgp
Description: PGP signature