Scan with ClamAV (extended)

Dolphin Service Menus

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

6
7.3
Description:

A short script to scan files or directories with ClamAV.
It provides the ability to scan multiple files, a progress-dialog and a result window.

Installation:
1. Start Dollphin
2. Press "Configure and control Dolphin" > "Configure Dolphin..."
3. Go to "Services"
4. "Download New Services..."
5. Search for my scripts name
6. Press "Install"

You need to have ClamAV installed.
If you encounter any issues when using the graphical way extract the file and run "sh install.sh".

All files are installed in the users home directory (/home/[user]/.kde[4]/share/kde4/services/ServiceMenus/ClamScan/), there is no need to use su or sudo to install

Note:
The script is currently translated in English, Finnish, French, German, Indonesian, Italian, Russian, Spanish, Swedish, Turkish and Ukrainian.
If you wish another language, translate the following and leave me a message or write it in a comment:
Name[en]=Scan with ClamAV
wait="ClamAV is scanning, please wait."
not_found="ClamAV is not installed!"
scan_sentence="Scanning files: "

Translations:
[li]English [/li][li]Finnish (Thanks to nikore90)[/li][li]French (Thanks to pbuard)[/li][li]German[/li][li]Indonesian (Thanks to JamurBulet)[/li][li]Italian (Thanks to Andrea Sciucca)[/li][li]Russian (Thanks to Omega9)[/li][li]Spanish[/li][li]Swedish (Thanks to Jonas Norlander)[/li][li]Turkish (Thanks to tanzer)[/li][li]Ukrainian (Thanks to Localizator (localizator@ukr.net))[/li]
Last changelog:

5 years ago

2013-6-18 (2.5.7)
- fixed permissions

2012-9-16 (2.5.6)
- fix: install-script: create path2 if it doesn't exist

2012-4-21 (2.5.5)
- support for linked directories
- support for empty directories
- unnecessary logfile gets deleted after scan, only result file remains
- fixed some if-conditions
- counts directories

2012-4-19 (2.5.4)
- fixed a wrong directory test (minor bug); now [ -d ] instead of [ -f ]
- did some testing on the mountable devices .desktop file, seems to work fine now

2012-4-19 (2.5.3)
- fixed a wrong set directory (~/.kde4/...) (that was for testing, I forgot to remove it)
- added spanish
- fixed this bug: gentooforum.de/artikel/17867/2/update-script.html when running ClamScan.sh without syntax

2012-2-23 (2.5.2)
- fixed recognition of empty directories which I broke in 2.3

2012-2-23 (2.5.1)
- Indonesian translation

2012-2-4 (2.5)
- using mkdir -p instead of if-conditions

(See Changelog file)

Don't forget to vote!

pru

7 years ago

Thank you for the script! It can be nicely added to the device notifier, go to:
'Device Notifier Settings -> Device Actions -> Add'
and set:
Title e.g.: 'Scan with ClamAV'
Command: /home/$USER/.kde/share/kde4/services/ServiceMenus/ClamScan/ClamScan.sh en %f
Icon e.g.: System icons -> Status -> security-medium
In the 'Device must match the following parameters for this action:' tree:

For top tree entry set:
Parameter type: Content Conjunction

For 1st subentry set:
Parameter type: Property Match
Device type: Storage Volume
Value name: Ignored
Equals: false

For 2nd subentry set:
Parameter type: Property Match
Device type: Storage Volume
Value name: Usage
Equals: FileSystem

The file will be created in:
/home/$USER/.kde/share/apps/solid/actions/<name>.desktop

with the following content:
--------------
[Desktop Action open]
Exec=/home/$USER/.kde/share/kde4/services/ServiceMenus/ClamScan/ClamScan.sh en %f
Icon=security-medium
Name=Scan with ClamAV

[Desktop Entry]
Actions=open;
Type=Service
X-KDE-Action-Custom=true
X-KDE-Solid-Predicate=[StorageVolume.ignored == 'false' AND StorageVolume.usage == 'FileSystem']
--------------

Report

C

Incarus

7 years ago

That is interesting.
I currently experiment with a modified .desktop file in that directory. As soon as this works as I want and after some testing I could add it to this script and to the installation routine

Report

C

Incarus

7 years ago

Got it fixed. My own script didn't work for me until I realised that my usb-stick folder contains a whitespace and that my script is not able to handle that.
I fixed the whitespace issue in the latest release so I can deliver now the modified clamscan.desktop file in the next version

Report

webguy

7 years ago

Well the autoinstall through Dolphin settings didn't work, for all the reasons outlined in the first few comments, but the manual way does, one I created the ClamScan folder for it to sit in

Thanks, it now works a treat

Report

nikore90

7 years ago

Name[fi]=Tarkista ClamAV:lla
wait="ClamAV tarkistaa valittuja tiedostoja, odota hetki."
not_found="ClamAV:a ei ole asennettu!"

Report

nikore90

7 years ago

"Finnish" not "Finish"

Report

C

Incarus

7 years ago

Of course, corrected! Thank you ;)

Report

FraMari

7 years ago

Hi,
I think that the folder location is wrong.
In should be ~/.kde4/share/kde4/services/ServiceMenus/ClamScan/, instead of ~/.kde/share/kde4/services/ServiceMenus/ClamScan/ClamScan.sh.

Report

C

Incarus

7 years ago

Hi,
I reviewed the complete source code and come to the following conclusion - correct me if I'm wrong:

There are two common locations for servicesmenus, on my machine (kde4-config --path services):
/home/USER/.kde/share/kde4/services/
and
/usr/share/kde4/services/

For my script I'm using the /home/USER/.kde/ (~/.kde) path because you can write in it without superuser-rights - not to mistaken with /usr/share/kde4/ (!).

However, I will try to completly use relative paths (kde4-config --path services) instead of absolute paths (/home/USER/...) in my next release, thank you!

Report

FraMari

7 years ago

In my /home directory there's only the /.kde4 folder; /.kde folder doesn't exist. I didn't used the /usr/share/kde4/services/ folder
In fact, when i tried to run the script, it told me that it couldn't find the ClamScan.sh in the folder ~/.kde/share/kde4/services/ServiceMenus/ClamScan/ClamScan.sh; so i changed the path, and now it works, for me.
Thank you!

Report

C

Incarus

7 years ago

Okay, the mentioned changed should fix that. I will release a fix later this day. Thanks!

Report

C

Incarus

7 years ago

*changes.

Thank you for reporting, issue is now fixed in the installation routine. If the services path is not the default path (and I hope that is rare) the installation script will replace the paths in ClamScan.desktop. I also replaced absolute paths in ClamScan.sh with relatives.
Not sure if there is another way to fix that - if you try to install it without install.sh and your .kde path is not the default one you could encouter problems.

Report

steveke

7 years ago

I see you already have a workaround, but you might be interested to use "kde4-config --localprefix --path services" to get the correct path :)

Report

C

Incarus

7 years ago

I am not happy with both solutions,
"kde4-config --localprefix"
and "kde4-config --path services"

The first one only returns "/home/USER/.kde/", the second "/home/USER/.kde/share/kde4/services/:/usr/share/kde4/services/"

The first one is unlucky, because the service menu path could differ so "/home/USER/.kde/" + "share/kde4/services" could go 404.
The second one have to be reduced, I'm using "echo ${path%:*}" to do that, which is not the best solution but at least it works.
In theory I need a syntax which only returns the user service menu path "/home/USER/.kde/share/kde4/services/".
My second problem is, that the .desktop file can not run a sh file in the same directory (like EXEC=sh abc.sh). I'm not sure but I think I saw scripts there this or something similar worked. If I'm able to get this to work only the install.sh file will be affected by the first problem.

Report

steveke

7 years ago

Hmm maybe just the first bit!

Report

FraMari

7 years ago

I'm going to try this right now.
Thanks to you!

Report

FraMari

7 years ago

It works like a charm!
thank you

Report

pbuard

7 years ago

Name[fr]=Analyser avec ClamAV
Exec[fr]=kdialog --title "Analyser avec ClamAV 1.3.6" --passivepopup "ClamAV analyse, veuillez patienter." 5 ; test -f /usr/bin/clamscan && kdialog --msgbox "Fichier(s) analysé(s) : \n %F \n\n Résultats:\n `clamscan -i -r %F ` \n" --title "Analyser avec ClamAV 1.3.6" || kdialog --msgbox "ClamAV n'est pas installé ! \n" --title "Impossible de trouver ClamAV"

Report

C

Incarus

7 years ago

Thank you!

Report

tanzer

7 years ago

[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=all/all;
X-KDE-StartupNotify=false
X-KDE-Priority=TopLevel
Actions=scanwithClam;

[Desktop Action scanwithClam]
Name=Scan with ClamAV
Name[de]=Mit ClamAV Scannen
Name[en]=Scan with ClamAV
Name[it]=Scansiona con ClamAV
Name[ru]=Сканирование ClamAV
Name[sv]=Skanna med ClamAV
Name[uk]=Сканування ClamAV
Name[tr]=ClamAV ile tara
Exec[de]=kdialog --title "Scan mit ClamAV 1.3.5" --passivepopup "ClamAV scannt, bitte warten." 5 ; test -f /usr/bin/clamscan && kdialog --msgbox "Durchsuchte Datei(en): \n %F \n\n Resultat:\n `clamscan -i -r %F ` \n" --title "Scan mit ClamAV 1.3.5" || kdialog --msgbox "ClamAV ist nicht installiert! \n" --title "ClamAV nicht gefunden"
Exec[en]=kdialog --title "Scan with ClamAV 1.3.5" --passivepopup "ClamAV is scanning, please wait." 5 ; test -f /usr/bin/clamscan && kdialog --msgbox "Scanned file(s): \n %F \n\n Results:\n `clamscan -i -r %F ` \n" --title "Scan with ClamAV 1.3.5" || kdialog --msgbox "ClamAV is not installed! \n" --title "ClamAV not found"
Exec[it]=kdialog --title "Scansiona con ClamAV 1.3.5" --passivepopup "ClamAV sta scansionando, attendi per favore." 5 ; test -f /usr/bin/clamscan && kdialog --msgbox "Dati scansionati: \n %F \n\n Results:\n `clamscan -i -r %F ` \n" --title "Scansiona con ClamAV 1.3.5" || kdialog --msgbox "ClamAV non è installato! \n" --title "ClamAV non è stato trovato"
Exec[ru]=kdialog --title "Сканирование ClamAV 1.3.5" --passivepopup "ClamAV проводит сканирование. Пожалуйста, подождите." 5 ; test -f /usr/bin/clamscan && kdialog --msgbox "Проверенные файлы: \n %F \n\n Результат:\n `clamscan -i -r %F ` \n" --title "Сканирование ClamAV 1.3.5" || kdialog --msgbox "ClamAV не установлен! \n" --title "ClamAV не найден"
Exec[sv]=kdialog --title "Skanna med ClamAV 1.3.5" --passivepopup "ClamAV skannar, vänta." 5 ; test -f /usr/bin/clamscan && kdialog --msgbox "Skannade filer: \n %F \n\n Resultat:\n `clamscan -i -r %F ` \n" --title "Skanna med ClamAV 1.3.5" || kdialog --msgbox "ClamAV verkar inte vara installerat! \n" --title "ClamAV hittades inte"
Exec[uk]=kdialog --title "Сканування ClamAV 1.3.5" --passivepopup "ClamAV проводить сканування. Будь ласка, зачекайте." 5 ; test -f /usr/bin/clamscan && kdialog --msgbox "Перевірені файли: \n %F \n\n Результат:\n `clamscan -i -r %F ` \n" --title "Сканування ClamAV 1.3.5" || kdialog --msgbox "ClamAV не встановлено! \n" --title "ClamAV не знайдено"
Exec[tr]=kdialog --title "ClamAV 1.3.5 ile tara" --passivepopup "ClamAV tarıyor, lütfen bekleyin." 5 ; test -f /usr/bin/clamscan && kdialog --msgbox "taranan dosya(lar): \n %F \n\n Results:\n `clamscan -i -r %F ` \n" --title "ClamAV 1.3.5 ile tara" || kdialog --msgbox "ClamAV kurulu değil! \n" --title "ClamAV bulunamadı"
Exec=kdialog --title "Scan with ClamAV 1.3.5" --passivepopup "ClamAV is scanning, please wait." 5 ; test -f /usr/bin/clamscan && kdialog --msgbox "Scanned file(s): \n %F \n\n Results:\n `clamscan -i -r %F ` \n" --title "Scan with ClamAV 1.3.5" || kdialog --msgbox "ClamAV is not installed! \n" --title "ClamAV not found"
Icon=security-medium

Report

C

Incarus

7 years ago

Added, thank you!

Report

gohanz

7 years ago

[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=all/all;
X-KDE-StartupNotify=false
X-KDE-Priority=TopLevel
Actions=scanwithClam;

[Desktop Action scanwithClam]
Name=Scan with ClamAV
Name[de]=Mit ClamAV Scannen
Name[en]=Scan with ClamAV
Name[it]=Scansiona con ClamAV
Name[ru]=Сканирование ClamAV
Name[sv]=Skanna med ClamAV
Name[uk]=Сканування ClamAV
Exec[de]=kdialog --title "Scan mit ClamAV 1.3.4" --passivepopup "ClamAV scannt, bitte warten." 5 ; test -f /usr/bin/clamscan && kdialog --msgbox "Durchsuchte Datei(en): \n %F \n\n Resultat:\n `clamscan -i -r %F ` \n" --title "Scan mit ClamAV 1.3.4" || kdialog --msgbox "ClamAV ist nicht installiert! \n" --title "ClamAV nicht gefunden"
Exec[en]=kdialog --title "Scan with ClamAV 1.3.4" --passivepopup "ClamAV is scanning, please wait." 5 ; test -f /usr/bin/clamscan && kdialog --msgbox "Scanned file(s): \n %F \n\n Results:\n `clamscan -i -r %F ` \n" --title "Scan with ClamAV 1.3.4" || kdialog --msgbox "ClamAV is not installed! \n" --title "ClamAV not found"
Exec[it]=kdialog --title "Scansiona con ClamAV 1.3.4" --passivepopup "ClamAV sta scansionando, attendi per favore." 5 ; test -f /usr/bin/clamscan && kdialog --msgbox "Dati scansionati: \n %F \n\n Results:\n `clamscan -i -r %F ` \n" --title "Scansiona con ClamAV 1.3.4" || kdialog --msgbox "ClamAV non è installato! \n" --title "ClamAV non è stato trovato"
Exec[ru]=kdialog --title "Сканирование ClamAV 1.3.4" --passivepopup "ClamAV проводит сканирование. Пожалуйста, подождите." 5 ; test -f /usr/bin/clamscan && kdialog --msgbox "Проверенные файлы: \n %F \n\n Результат:\n `clamscan -i -r %F ` \n" --title "Сканирование ClamAV 1.3.4" || kdialog --msgbox "ClamAV не установлен! \n" --title "ClamAV не найден"
Exec[sv]=kdialog --title "Skanna med ClamAV 1.3.4" --passivepopup "ClamAV skannar, vänta." 5 ; test -f /usr/bin/clamscan && kdialog --msgbox "Skannade filer: \n %F \n\n Resultat:\n `clamscan -i -r %F ` \n" --title "Skanna med ClamAV 1.3.4" || kdialog --msgbox "ClamAV verkar inte vara installerat! \n" --title "ClamAV hittades inte"
Exec[uk]=kdialog --title "Сканування ClamAV 1.3.4" --passivepopup "ClamAV проводить сканування. Будь ласка, зачекайте." 5 ; test -f /usr/bin/clamscan && kdialog --msgbox "Перевірені файли: \n %F \n\n Результат:\n `clamscan -i -r %F ` \n" --title "Сканування ClamAV 1.3.4" || kdialog --msgbox "ClamAV не встановлено! \n" --title "ClamAV не знайдено"
Exec=kdialog --title "Scan with ClamAV 1.3.4" --passivepopup "ClamAV is scanning, please wait." 5 ; test -f /usr/bin/clamscan && kdialog --msgbox "Scanned file(s): \n %F \n\n Results:\n `clamscan -i -r %F ` \n" --title "Scan with ClamAV 1.3.4" || kdialog --msgbox "ClamAV is not installed! \n" --title "ClamAV not found"
Icon=security-medium

Report

C

Incarus

7 years ago

aww, I Forgot to comment that. Thanks for the translation, I added it ;)

Report

Omega9

8 years ago

[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=all/all;
X-KDE-StartupNotify=false
X-KDE-Priority=TopLevel
Actions=scanwithClam;

[Desktop Action scanwithClam]
Name=Scan with ClamAV
Name[de]=Mit ClamAV Scannen
Name[en]=Scan with ClamAV
Name[sv]=Skanna med ClamAV
Name[ru]=Сканирование ClamAV
Exec[de]=kdialog --title "Scan mit ClamAV 1.3.2" --passivepopup "ClamAV scannt, bitte warten." 5 ; test -f /usr/bin/clamscan && kdialog --msgbox "Durchsuchte Datei(en): \n %F \n\n Resultat:\n `clamscan -i -r %F ` \n" --title "Scan mit ClamAV 1.3.2" || kdialog --msgbox "ClamAV ist nicht installiert! \n" --title "ClamAV nicht gefunden"
Exec[en]=kdialog --title "Scan with ClamAV 1.3.2" --passivepopup "ClamAV is scanning, please wait." 5 ; test -f /usr/bin/clamscan && kdialog --msgbox "Scanned file(s): \n %F \n\n Results:\n `clamscan -i -r %F ` \n" --title "Scan with ClamAV 1.3.2" || kdialog --msgbox "ClamAV is not installed! \n" --title "ClamAV not found"
Exec[sv]=kdialog --title "Skanna med ClamAV 1.3.2" --passivepopup "ClamAV skannar, vänta." 5 ; test -f /usr/bin/clamscan && kdialog --msgbox "Skannade filer: \n %F \n\n Resultat:\n `clamscan -i -r %F ` \n" --title "Skanna med ClamAV 1.3.2" || kdialog --msgbox "ClamAV verkar inte vara installerat! \n" --title "ClamAV hittades inte"
Exec[ru]=kdialog --title "Сканирование ClamAV 1.3.2" --passivepopup "ClamAV проводит сканирование. Пожалуйста, подождите." 5 ; test -f /usr/bin/clamscan && kdialog --msgbox "Проверенные файлы: \n %F \n\n Результат:\n `clamscan -i -r %F ` \n" --title "Сканирование ClamAV 1.3.2" || kdialog --msgbox "ClamAV не установлен! \n" --title "ClamAV не найден"
Exec=kdialog --title "Scan with ClamAV 1.3.2" --passivepopup "ClamAV is scanning, please wait." 5 ; test -f /usr/bin/clamscan && kdialog --msgbox "Scanned file(s): \n %F \n\n Results:\n `clamscan -i -r %F ` \n" --title "Scan with ClamAV 1.3.2" || kdialog --msgbox "ClamAV is not installed! \n" --title "ClamAV not found"
Icon=security-medium

Report

Omega9

8 years ago

[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=all/all;
X-KDE-StartupNotify=false
X-KDE-Priority=TopLevel
Actions=scanwithClam;

[Desktop Action scanwithClam]
Name=Scan with ClamAV
Name[de]=Mit ClamAV Scannen
Name[en]=Scan with ClamAV
Name[sv]=Skanna med ClamAV
Name[ru]=Сканирование ClamAV
Exec[de]=kdialog --title "Scan mit ClamAV 1.3.2" --passivepopup "ClamAV scannt, bitte warten." 5 ; test -f /usr/bin/clamscan && kdialog --msgbox "Durchsuchte Datei(en): \n %F \n\n Resultat:\n `clamscan -i -r %F ` \n" --title "Scan mit ClamAV 1.3.2" || kdialog --msgbox "ClamAV ist nicht installiert! \n" --title "ClamAV nicht gefunden"
Exec[en]=kdialog --title "Scan with ClamAV 1.3.2" --passivepopup "ClamAV is scanning, please wait." 5 ; test -f /usr/bin/clamscan && kdialog --msgbox "Scanned file(s): \n %F \n\n Results:\n `clamscan -i -r %F ` \n" --title "Scan with ClamAV 1.3.2" || kdialog --msgbox "ClamAV is not installed! \n" --title "ClamAV not found"
Exec[sv]=kdialog --title "Skanna med ClamAV 1.3.2" --passivepopup "ClamAV skannar, vänta." 5 ; test -f /usr/bin/clamscan && kdialog --msgbox "Skannade filer: \n %F \n\n Resultat:\n `clamscan -i -r %F ` \n" --title "Skanna med ClamAV 1.3.2" || kdialog --msgbox "ClamAV verkar inte vara installerat! \n" --title "ClamAV hittades inte"
Exec[ru]=kdialog --title "Сканирование ClamAV 1.3.2" --passivepopup "ClamAV проводит сканирование. Пожалуйста, подождите." 5 ; test -f /usr/bin/clamscan && kdialog --msgbox "Проверенные файлы: \n %F \n\n Результат:\n `clamscan -i -r %F ` \n" --title "Сканирование ClamAV 1.3.2" || kdialog --msgbox "ClamAV не установлен! \n" --title "ClamAV не найден"
Exec=kdialog --title "Scan with ClamAV 1.3.2" --passivepopup "ClamAV is scanning, please wait." 5 ; test -f /usr/bin/clamscan && kdialog --msgbox "Scanned file(s): \n %F \n\n Results:\n `clamscan -i -r %F ` \n" --title "Scan with ClamAV 1.3.2" || kdialog --msgbox "ClamAV is not installed! \n" --title "ClamAV not found"
Icon=security-medium

Report

5 years ago

2013-6-18 (2.5.7)
- fixed permissions

2012-9-16 (2.5.6)
- fix: install-script: create path2 if it doesn't exist

2012-4-21 (2.5.5)
- support for linked directories
- support for empty directories
- unnecessary logfile gets deleted after scan, only result file remains
- fixed some if-conditions
- counts directories

2012-4-19 (2.5.4)
- fixed a wrong directory test (minor bug); now [ -d ] instead of [ -f ]
- did some testing on the mountable devices .desktop file, seems to work fine now

2012-4-19 (2.5.3)
- fixed a wrong set directory (~/.kde4/...) (that was for testing, I forgot to remove it)
- added spanish
- fixed this bug: gentooforum.de/artikel/17867/2/update-script.html when running ClamScan.sh without syntax

2012-2-23 (2.5.2)
- fixed recognition of empty directories which I broke in 2.3

2012-2-23 (2.5.1)
- Indonesian translation

2012-2-4 (2.5)
- using mkdir -p instead of if-conditions

(See Changelog file)

Don't forget to vote!

12345678910
220
product-maker janet Nov 17 2015 8 great
product-maker brabus84 Mar 28 2014 8 great
product-maker msx Jul 26 2013 8 great
product-maker gustawho Jul 07 2013 8 great
product-maker Seniazi Jun 19 2013 8 great
product-maker electron222 Jun 10 2013 8 great
product-maker Omega9 Apr 10 2013 8 great
product-maker mixalns Sep 16 2012 8 great
product-maker som123xxx Sep 16 2012 3 bad
product-maker RAIDENSUB Aug 15 2012 8 great
product-maker narya Apr 22 2012 8 great
product-maker roctheme Jan 27 2012 8 great
product-maker pru Jan 15 2012 8 great
product-maker pbuard Dec 19 2011 8 great
product-maker nikore90 Nov 11 2011 8 great
product-maker FraMari Jun 26 2011 8 great
product-maker gohanz Jun 26 2011 8 great
product-maker jorssoftware Feb 09 2011 8 great
product-maker svah4cky0 Jan 09 2011 8 great
product-maker deabru Jan 08 2011 8 great
product-maker sylgil88 Jan 08 2011 8 great
product-maker vitoubien Jan 08 2011 3 bad
product-maker Count:2 Rating: 5.00
File (click to download) Version Description Downloads Date Filesize DL OCS-Install
Pling
*Needs ocs-url or ocs-store to install things
Details
license
version
2.5.7
updated Jun 18 2013
added Jan 08 2011
downloads today
1
page views today 11
System Tags addon
+