security.d/chk_clamav

Sun, 30 Nov 2008 23:12:42 +0100

author
mbse
date
Sun, 30 Nov 2008 23:12:42 +0100
changeset 3
09c6b23f6c6c
child 14
59e07bba67cc
permissions
-rw-r--r--

New clamav check

3
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
1 #!/bin/bash
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
2 #
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
3 # $Id$
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
4 #
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
5 #############################################################################
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
6 # Copyright (C) 2005-2007
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
7 #
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
8 # Michiel Broek <mbse@mbse.eu>
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
9 # Beekmansbos 10
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
10 # 1971 BV IJmuiden
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
11 # the Netherlands
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
12 #
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
13 # This file is part of SlackSecCheckSripts.
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
14 #
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
15 # This package is free software; you can redistribute it and/or modify it
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
16 # under the terms of the GNU General Public License as published by the
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
17 # Free Software Foundation; either version 2, or (at your option) any
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
18 # later version.
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
19 #
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
20 # SlackSecCheckSripts is distributed in the hope that it will be useful, but
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
21 # WITHOUT ANY WARRANTY; without even the implied warranty of
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
23 # General Public License for more details.
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
24 #
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
25 # You should have received a copy of the GNU General Public License
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
26 # along with MBSE BBS; see the file COPYING. If not, write to the Free
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
27 # Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
28 #############################################################################
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
29
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
30
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
31 PATH=/sbin:/usr/sbin:/bin:/usr/bin
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
32
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
33 umask 077
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
34 TZ=UTC; export TZ
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
35 LANG=C; export LANG
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
36
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
37 SECUREDIR=`mktemp -d /tmp/_securedir.XXXXXX` || exit 1
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
38
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
39 trap "/bin/rm -rf $SECUREDIR ; exit 0" EXIT INT QUIT PIPE
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
40
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
41 if ! cd "$SECUREDIR"; then
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
42 echo "Can not cd to $SECUREDIR".
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
43 exit 1
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
44 fi
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
45
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
46 OUTPUT=secure1.$$
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
47
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
48
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
49 if [ -x /usr/bin/clamscan ]; then
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
50 echo "" |clamscan --quiet - >> $OUTPUT 2>&1
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
51 fi
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
52
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
53 if [ -s $OUTPUT ] ; then
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
54 printf "\nChecking: "
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
55 clamscan --version
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
56 cat $OUTPUT
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
57 fi
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
58
09c6b23f6c6c New clamav check
mbse
parents:
diff changeset
59

mercurial