diff options
Diffstat (limited to 'src/action/ScanWithKlamAV')
-rw-r--r-- | src/action/ScanWithKlamAV | 30 |
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 + |