Appendix A
71
sname=${bname%%.*}
if [ ! -d $TEMP ]; then
mkdir -p $TEMP
fi
## tar
if [ $suf == gz -o $suf == tgz ] ; then
list=`tar -ztf $name`
tar -C $TEMP -zxf $name
$KAVKAVSCANNER -c $CONF -i3 $TEMP
cd $TEMP
tar -czf $sname.tgz *
for i in $list
do
j=${i##/*/}
rm $j
done
mv $TEMP/$sname.tgz $SPWD/$sname.tgz.cure
rm -rf $TEMP
## zip
elif [ $suf == zip ] ; then
list=`unzip -l $name`
unzip $name -d $TEMP
$KAVKAVSCANNER -c $CONF -i3 $TEMP
cd $TEMP
zip $sname.zip -r .
echo $SPWD
mv $TEMP/$sname.zip $SPWD/$sname.zip.cure
rm -rf $TEMP