# @(#) $Id: f_mircweed.sh,v 1.11 2021/01/13 13:19:00 ralph Exp $
# ---------------------------------------------------------------------------
# (c) 1997-2021 by ROSE_SWE, Ralph Roth,

# This script is only useful and only works under Linux. Requires RAR installed.
# Assumes FindMirc is in the current directory, if not edit this script :-)
# Works only under Linux with NO SPACES in the file names!

# [ -z "$1" ] || exit 1

./f_mirc $1 -all -log -logdel $2 $3 $4
i=$(grep "Note: Corrupted" f_mirc.log|awk '{ print $1; }')
#echo $i

rem rar a = ADD, rar m = MOVE!

[ -n "$i" ] && rar a -s -ag ~/CorruptedMalware_ "$i"

echo "Moving Malware...."
i=$(grep -v "Note: Corrupted" f_mirc.log|grep "^/"|awk '{ print $1; }')
echo $i

[ -n "$i" ] && rar a -s -ag ~/FoundMalware_ "$i"

# For CYGWIN use:
#
# grep "^C\:" f_mirc.log | awk -F"  |\t" '{ printf("%s\n", $1); }' >xx
# rar a -ag malware_ @xx
