#
# H+B EDV AntiVir
#

if ($antivir) {
    do_log(2,"Using $antivir");
    chop($output = `$antivir -allfiles -noboot -s -z $TEMPDIR/parts`);
    $errval = retcode($?);
    do_log(2,$output);
    if ($errval == 0) {			# no errors, no viruses found
	$scanner_errors = 0;
    } elsif ($errval == 1) {		# no errors, viruses discovered
	$scanner_errors = 0;
	# AntiVir < 2.0.4
	if ( $output =~ /VIRUS:/ ) {
	    @virusname = ($output =~ /VIRUS: .* virus (.+)/ig);
	# AntiVir > 2.0.4
	} elsif ( $output =~ /ALERT:/ ) {
	    @virusname = ($output =~ /ALERT: \[(\S+)\s.*?\]/g);
	}
	@virusname = (undef)  if !@virusname;  # just in case: make list nonnil
	do_virus();
    } else {
	do_log(0,"Virus scanner failure: $antivir (error code: $errval)");
    }
}
