weil es kein wirklich sicheres system gegen computervieren gibt, habe ich eine open-source email-waschmaschine geschrieben. 100 % sicher bei getrennten systemen. hier ist sie:
#!/bin/bash
# open-source anhaenge-downloads schadware-reiniger 27mrz2018c
#
# email ed.bew@nnameen_samoht bitte wenden
cd /wama/in
find . -exec rename 's/[^a-zA-Z0-9-.\/]/_/g' {} \;
find . -type f | while read i; do mv "$i" "`echo "$i" | tr "A-Z" "a-z"`"; done
cp /wama/in/*.zip /wama/zip
rm /wama/in/*.zip
# apt-get install 7z
cd /wama/zip
list200=$(echo *)
if [ "$list200" = "*" ]
then
echo "zip-leer"
else
for file300 in *.zip
do
7z e $file300 -o/wama/entzip
done
rm /wama/zip/*
fi
find /wama/entzip -type f -name "*" -exec mv -i {} /wama/in \;
rm -r /wama/entzip/*
cd /wama/in
find . -exec rename 's/[^a-zA-Z0-9-.\/]/_/g' {} \;
find . -type f | while read i; do mv "$i" "`echo "$i" | tr "A-Z" "a-z"`"; done
cp /wama/in/*.rar /wama/rar
rm /wama/in/*.rar
cd /wama/rar
list200=$(echo *)
if [ "$list200" = "*" ]
then
echo "rar-leer"
else
for file300 in *.rar
do
unrar e $file300 /wama/in
done
rm /wama/rar/*
fi
cp /wama/in/*.pdf /wama/pdf
rm /wama/in/*.pdf
cp /wama/in/*.xls /wama/xls
rm /wama/in/*.xls
cp /wama/in/*.xlsm /wama/xlsm
rm /wama/in/*.xlsm
cp /wama/in/*.xlsx /wama/xlsx
rm /wama/in/*.xlsx
cp /wama/in/*.doc /wama/doc
rm /wama/in/*.doc
cp /wama/in/*.docm /wama/docm
rm /wama/in/*.docm
cp /wama/in/*.docx /wama/docx
rm /wama/in/*.docx
cp /wama/in/*.jpg /wama/jpg/
rm /wama/in/*.jpg
cp /wama/in/*.bmp /wama/bmp2
rm /wama/in/*.bmp
cp /wama/in/*.p83 /wama/txt
rm /wama/in/*.p83
cp /wama/in/*.p81 /wama/txt
rm /wama/in/*.p81
cp /wama/in/*.p84 /wama/txt
rm /wama/in/*.p84
cp /wama/in/*.p82 /wama/txt
rm /wama/in/*.p82
cp /wama/in/*.p85 /wama/txt
rm /wama/in/*.p85
cp /wama/in/*.p86 /wama/txt
rm /wama/in/*.p86
cp /wama/in/*.d81 /wama/txt
rm /wama/in/*.d81
cp /wama/in/*.d82 /wama/txt
rm /wama/in/*.d82
cp /wama/in/*.d83 /wama/txt
rm /wama/in/*.d83
cp /wama/in/*.d84 /wama/txt
rm /wama/in/*.d84
cp /wama/in/*.d85 /wama/txt
rm /wama/in/*.d85
cp /wama/in/*.d86 /wama/txt
rm /wama/in/*.d86
cp /wama/in/*.plt /wama/plt
rm /wama/in/*.plt
cp /wama/in/*.txt /wama/txt
rm /wama/in/*.txt
cp /wama/in/*.dxf /wama/txt
rm /wama/in/*.dxf
cp /wama/in/*.dwg /wama/dwg
rm /wama/in/*.dwg
cp /wama/in/*.igs /wama/txt
rm /wama/in/*.igs
cp /wama/in/*.step /wama/txt
rm /wama/in/*.step
cp /wama/in/*.stp /wama/txt
rm /wama/in/*.stp
cp /wama/in/*.p21 /wama/txt
rm /wama/in/*.p21
cp /wama/in/*.odt /wama/odt
rm /wama/in/*.odt
cp /wama/in/*.ods /wama/ods
rm /wama/in/*.ods
cp /wama/in/*.ifc /wama/txt
rm /wama/in/*.ifc
cp /wama/in/*.png /wama/png
rm /wama/in/*.png
cp /wama/in/*.tif /wama/tif
rm /wama/in/*.tif
cp /wama/in/*.gif /wama/gif
rm /wama/in/*.gif
cp /wama/in/*.ppt /wama/ppt
rm /wama/in/*.ppt
cp /wama/in/*.pptx /wama/pptx
rm /wama/in/*.pptx
cp /wama/in/*.mp4 /wama/mp4
rm /wama/in/*.mp4
cp /wama/in/*.avi /wama/avi
rm /wama/in/*.avi
cp /wama/in/*.jpeg /wama/jpeg
rm /wama/in/*.jpeg
cp /wama/in/*.off /wama/txt
rm /wama/in/*.off
# sudo add-apt-repository ppa:mc3man/trusty-media
# sudo apt-get update
# sudo apt-get install ffmpeg
# sudo apt-get install dvdauthor
# ffmpeg -i 1.mp4 -target pal-dvd -aspect 16:9 -ac 2 1.mpg
# ffmpeg -i 1.mpg 1b.mp4
cd /wama/avi
list=$(echo *)
if [ "$list" = "*" ]
then
echo "avi-leer"
else
for file10 in *
do
ffmpeg -i $file10 -vcodec mpeg4 -vtag XVID -b 990k -bf 2 -g 300 -s 640x360 -acodec libmp3lame -ab 128k -ar 48000 -ac 2 -pass 2 -threads 0 -f avi /wama/sauber/$file10.avi
done
rm /wama/avi/*
fi
cd /wama/mp4
list=$(echo *)
if [ "$list" = "*" ]
then
echo "mp4-leer"
else
for file10 in *.mp4
do
ffmpeg -i $file10 -target pal-dvd -aspect 16:9 -ac 2 $file10.mpg
ffmpeg -i $file10.mpg /wama/sauber/$file10
done
rm /wama/mp4/*
fi
#sudo apt install dos2unix
cd /wama/plt
list2=$(echo *)
if [ "$list2" = "*" ]
then
echo "plt-leer"
else
for file21 in *
do
sed -n '1,1p' $file21 > 1z
sed -n '$p' $file21 > lz
sed '$d' $file21 > ohnelz
sed -n '2,$p' ohnelz > rest.txt
unix2dos -n rest.txt /wama/txtconv/rest.txt
dos2unix -n /wama/txtconv/rest.txt rest.txt
cat rest.txt >> 1z
cat lz >> 1z
cp 1z /wama/sauber/$file21
rm 1z
rm ohnelz
rm /wama/txtconv/rest.txt
rm lz
rm rest.txt
done
rm /wama/plt/*
rm /wama/txtconv/*
fi
cd /wama/txt
list2=$(echo *)
if [ "$list2" = "*" ]
then
echo "txt-leer"
else
for file21 in *
do
unix2dos -n $file21 /wama/txtconv/$file21
dos2unix -n /wama/txtconv/$file21 /wama/sauber/$file21
done
rm /wama/txt/*
rm /wama/txtconv/*
fi
cd /wama/bmp2
list2=$(echo *)
if [ "$list2" = "*" ]
then
echo "bmp2-leer"
else
for file20 in *
do
#apt-get install imagemagick
convert /wama/bmp2/$file20 /wama/sauber/$file20
done
rm /wama/bmp2/*
fi
cd /wama/jpg
list2=$(echo *)
if [ "$list2" = "*" ]
then
echo "jpg-leer"
else
for file20 in *.jpg
do
#apt-get install imagemagick
convert $file20 /wama/bmp/$file20.bmp
convert /wama/bmp/$file20.bmp /wama/sauber/$file20
done
rm /wama/bmp/*
rm /wama/jpg/*
fi
cd /wama/jpeg
list2=$(echo *)
if [ "$list2" = "*" ]
then
echo "jpeg-leer"
else
for file20 in *.jpeg
do
#apt-get install imagemagick
convert $file20 /wama/bmp/$file20.bmp
convert /wama/bmp/$file20.bmp /wama/sauber/$file20
done
rm /wama/bmp/*
rm /wama/jpeg/*
fi
cd /wama/png
list2=$(echo *)
if [ "$list2" = "*" ]
then
echo "png-leer"
else
for file20 in *.png
do
#apt-get install imagemagick
convert $file20 /wama/bmp/$file20.bmp
convert /wama/bmp/$file20.bmp /wama/sauber/$file20
done
rm /wama/bmp/*
rm /wama/png/*
fi
cd /wama/tif
list2=$(echo *)
if [ "$list2" = "*" ]
then
echo "tif-leer"
else
for file20 in *.tif
do
#apt-get install imagemagick
convert $file20 /wama/bmp/$file20.bmp
convert /wama/bmp/$file20.bmp /wama/sauber/$file20.tif
done
rm /wama/bmp/*
rm /wama/tif/*
fi
cd /wama/gif
list20=$(echo *)
if [ "$list20" = "*" ]
then
echo "gif-leer"
else
for file30 in *.gif
do
#apt-get install imagemagick
convert $file30 /wama/bmp/$file30.bmp
convert /wama/bmp/$file30.bmp /wama/sauber/$file30.gif
done
rm /wama/bmp/*
rm /wama/gif/*
fi
cd /wama/pdf
list=$(echo *)
if [ "$list" = "*" ]
then
echo "pdf-leer"
else
for file14 in *.pdf
do
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -sOutputFile=/wama/sauber/$file14 $file14
done
rm /wama/pdf/*
fi
cd /wama/odt
list=$(echo *)
if [ "$list" = "*" ]
then
echo "odt-leer"
else
for file10 in *.odt
do
libreoffice --writer --convert-to docx $file10 --outdir /wama/sauber --headless
done
rm /wama/odt/*
fi
cd /wama/ppt
list=$(echo *)
if [ "$list" = "*" ]
then
echo "ppt-leer"
else
for file100 in *.ppt
do
libreoffice --impress --convert-to pdf $file100 --outdir /wama/sauber --headless
done
rm /wama/ppt/*
fi
cd /wama/pptx
list=$(echo *)
if [ "$list" = "*" ]
then
echo "pptx-leer"
else
for file101 in *.pptx
do
libreoffice --impress --convert-to pdf $file101 --outdir /wama/sauber --headless
done
rm /wama/pptx/*
fi
cd /wama/ods
list=$(echo *)
if [ "$list" = "*" ]
then
echo "ods-leer"
else
for file11 in *.ods
do
libreoffice --calc --convert-to xlsx $file11 --outdir /wama/sauber --headless
done
rm /wama/ods/*
fi
cd /wama/xls
list=$(echo *)
if [ "$list" = "*" ]
then
echo "xls-leer"
else
for file5 in *.xls
do
libreoffice --calc --convert-to xlsx $file5 --outdir /wama/xlsx-2 --headless
done
rm /wama/xls/*
fi
cd /wama/xlsm
list=$(echo *)
if [ "$list" = "*" ]
then
echo "xlsm-leer"
else
for file3 in *.xlsm
do
libreoffice --calc --convert-to xlsx $file3 --outdir /wama/xlsx-2 --headless
done
rm /wama/xlsm/*
fi
cd /wama/xlsx
list=$(echo *)
if [ "$list" = "*" ]
then
echo "xlsx-leer"
else
for file4 in *.xlsx
do
libreoffice --calc --convert-to xlsx $file4 --outdir /wama/xlsx-2 --headless
done
rm /wama/xlsx/*
fi
cd /wama/xlsx-2
list=$(echo *)
if [ "$list" = "*" ]
then
echo "xlsx-leer"
else
for file13 in *
do
libreoffice --calc --convert-to xls $file13 --outdir /wama/sauber --headless
done
rm /wama/xlsx-2/*
fi
cd /wama/docm
list=$(echo *)
if [ "$list" = "*" ]
then
echo "docm-leer"
else
for file6 in *.docm
do
libreoffice --writer --convert-to docx $file6 --outdir /wama/docx-2 --headless
done
rm /wama/docm/*
fi
cd /wama/doc
list=$(echo *)
if [ "$list" = "*" ]
then
echo "doc-leer"
else
for file8 in *.doc
do
libreoffice --writer --convert-to docx $file8 --outdir /wama/docx-2 --headless
done
rm /wama/doc/*
fi
cd /wama/docx
list=$(echo *)
if [ "$list" = "*" ]
then
echo "docx-leer"
else
for file7 in *.docx
do
libreoffice --writer --convert-to docx $file7 --outdir /wama/docx-2 --headless
done
rm /wama/docx/*
fi
cd /wama/docx-2
list=$(echo *)
if [ "$list" = "*" ]
then
echo "docx-2-leer"
else
for file12 in *
do
libreoffice --writer --convert-to doc $file12 --outdir /wama/sauber --headless
done
rm /wama/docx-2/*
fi
cd /wama/in
list=$(echo *)
if [ "$list" = "*" ]
then
echo "in-leer"
else
ls > /wama/sauber/info.txt
echo "nicht gesäuberte datei(en), eventuell gefährlich" >> /wama/sauber/info.txt
rm /wama/in/*
fi
cd /wama/dwg
list=$(echo *)
if [ "$list" = "*" ]
then
echo "dwg-leer"
else
for file9 in *.dwg
do
#
https://www.opendesign.com/guestfiles/teigha_file_converter (Archiv-Version vom 08.08.2017)TeighaFileConverter "/wama/dwg/" "/wama/sauber/" "ACAD2010" "DWG" "0" "1"
done
rm /wama/dwg/*
fi
rm /wama/in/*
# cp /wama/sauber/* /media/sf_000downloads