summaryrefslogtreecommitdiffstats
path: root/src/action/ScanWithKlamAV
diff options
context:
space:
mode:
authorMavridis Philippe <mavridisf@gmail.com>2021-01-13 19:26:24 +0200
committerMavridis Philippe <mavridisf@gmail.com>2021-01-13 19:26:24 +0200
commit8c20dc919f7d54eb48fb60f39ba5e1d466a70763 (patch)
tree44d89f278d5dd066603e5ab9c0b270bc8eb4ad51 /src/action/ScanWithKlamAV
downloadklamav-8c20dc919f7d54eb48fb60f39ba5e1d466a70763.tar.gz
klamav-8c20dc919f7d54eb48fb60f39ba5e1d466a70763.zip
Initial commit
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
Diffstat (limited to 'src/action/ScanWithKlamAV')
-rw-r--r--src/action/ScanWithKlamAV30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/action/ScanWithKlamAV b/src/action/ScanWithKlamAV
new file mode 100644
index 0000000..27cb92c
--- /dev/null
+++ b/src/action/ScanWithKlamAV
@@ -0,0 +1,30 @@
+#!/bin/bash -v
+#
+# Executed from KDE Service Menu
+#
+
+# Execution starts here
+if [ "$1" = "" ]; then
+ exit 1
+fi
+
+SCANTHIS=("$@")
+
+until [ -z "$1" ] # Until all parameters used up...
+do
+ if [ "$URL" = "" ]; then
+ URL=$1
+ SCANTHIS=$1
+ else
+ URL=$URL'*'$1
+ SCANTHIS=$SCANTHIS' '$1
+ fi
+ shift
+done
+
+if dcop `dcop|grep klamav|head -n 1` DCOPKlamscan scanURLs "$URL"; then
+ exit 0
+else
+ klamav --scanthis "${SCANTHIS[@]}"
+fi
+