#!/bin/sh

if [ "$#" -ne 2 ]; then
    echo "Usage: $0 input_file output_file"
    exit 1
fi

# Run 'cat' with the system libraries, before overwriting LD_LIBRARY_PATH.
ports="$(cat ports.txt)"

export LD_LIBRARY_PATH="/opt/bitdefender/lib:${LD_LIBRARY_PATH}"

cd /opt/bitdefender/va/self_scan
# attention! nothing will be executed after the following line (see 'exec' below)
exec /opt/bitdefender/va/self_scan/main -y 1 -c 16 -p "${ports}" -i "$1" -o "$2"
