File tree Expand file tree Collapse file tree 2 files changed +48
-0
lines changed
Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ # ClamAV
2+
3+ Helper scripts for ClamAV.
4+
5+ Install e.g. into ` /usr/local/bin ` and add to ` VirusEvent ` in ` clamd.conf ` .
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # {{{
4+
5+ set -uo pipefail
6+
7+ stderr () {
8+ echo -e " ${@ } " 1>&2
9+ }
10+
11+ fail () {
12+ stderr " ${1:- } "
13+ stderr " "
14+ stderr " Exiting …"
15+ exit " ${2:- 1} "
16+ }
17+
18+ if [[ $# -ne 0 ]]; then
19+ stderr " "
20+ stderr " USAGE:"
21+ stderr " ${0} "
22+ stderr " "
23+ exit 0
24+ fi
25+
26+ missing_dependencies=false
27+ declare -r dependencies=(
28+ sendmail
29+ )
30+ for dep in " ${dependencies[@]} " ; do
31+ if ! command -v " ${dep} " & > /dev/null; then
32+ stderr " ❌ ERROR: Missing dependency ${dep} "
33+ missing_dependencies=true
34+ fi
35+ done
36+ if ${missing_dependencies} ; then
37+ fail ' Please install the missing dependencies!'
38+ fi
39+
40+ # }}}
41+
42+ echo -e " Subject: Virus found by ClamAV\!\n\nClamAV scanned ${CLAM_VIRUSEVENT_FILENAME} and found virus ${CLAM_VIRUSEVENT_VIRUS} \!" \
43+ | sendmail root
You can’t perform that action at this time.
0 commit comments