#! /bin/bash
#     Copyright (C) 2005, 2006 Stewart Adam
#    This file is part of FWVirusScanner.

#    FWVirusScanner is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.

#    FWVirusScanner is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.

#    You should have received a copy of the GNU General Public License
#    along with FWVirusScanner; if not, write to the Free Software
#    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
(
freshclam > /var/log/clamav/progress.log &
pid=$(echo $!)
while [ "$(ps -A | grep $pid)" != "" ];do
echo "#$(tail -n 1 /var/log/clamav/progress.log)"
sleep 0.1
done
) | zenity --progress --percentage=0 --width="400"
result=$(cat -vT /var/log/clamav/progress.log | grep -v '[|]')
zenity --info --text "Result:
$result"
rm /var/log/clamav/progress.log
