#!/bin/sh
# BitDefender STDIN scanner integration script
# Copyright (C) 1996-2014 BITDEFENDER SRL. All rights reserved.

# Place this script in your BitDefender installation directory
# and name it bdscanpipe, such as:
#   /opt/BitDefender-scanner/bin/bdscanpipe

# Set some parameters
BDSCAN=bdscan
TMPFILE=/tmp/bdscanpipe_$$

# Save the standard-input to a temporary file
cat > $TMPFILE

# Scan it with BitDefender and remember the exitcode
$BDSCAN $TMPFILE
EXIT=$?

# Remove the temporary file and return the exitcode
rm -f $TMPFILE
exit $EXIT

# End of the script
