Sat, 15 Aug 2009 15:29:33 +0200
Include tmpfs filesystems
5 | 1 | #!/bin/bash |
2 | # | |
3 | ############################################################################# | |
10 | 4 | # Copyright (C) 2005-2009 |
5 | 5 | # |
6 | # Michiel Broek <mbse@mbse.dds.nl> | |
7 | # Beekmansbos 10 | |
8 | # 1971 BV IJmuiden | |
9 | # the Netherlands | |
10 | # | |
11 | # This file is part of SlackSecCheckSripts. | |
12 | # | |
13 | # This package is free software; you can redistribute it and/or modify it | |
14 | # under the terms of the GNU General Public License as published by the | |
15 | # Free Software Foundation; either version 2, or (at your option) any | |
16 | # later version. | |
17 | # | |
18 | # SlackSecCheckSripts is distributed in the hope that it will be useful, but | |
19 | # WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
21 | # General Public License for more details. | |
22 | # | |
23 | # You should have received a copy of the GNU General Public License | |
24 | # along with MBSE BBS; see the file COPYING. If not, write to the Free | |
25 | # Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | |
26 | ############################################################################# | |
27 | ||
10 | 28 | VERSION=0.14 |
5 | 29 | export PATH=/bin:/usr/bin:/sbin:/usr/sbin |
30 | umask 077 | |
31 | LANG=C; export LANG | |
32 | ||
33 | fqdn=`hostname -f` | |
34 | date=`date` | |
35 | ||
36 | if [ "${MAILTO}" = "" ]; then | |
37 | MAILTO=root@$fqdn | |
38 | fi | |
39 | ||
40 | DAILYDIR=`mktemp -d /tmp/_daily.XXXXXX` || exit 1 | |
41 | SECOUT="$DAILYDIR/secout" | |
42 | TMP1="$DAILYDIR/tmp1" | |
43 | ||
44 | trap "/bin/rm -rf $DAILYDIR ; exit 0" EXIT INT QUIT | |
45 | ||
46 | if ! cd "$DAILYDIR"; then | |
47 | echo "Can not cd to $DAILYDIR". | |
48 | exit 1 | |
49 | fi | |
50 | ||
51 | ||
52 | # Check chk_* scripts in /etc/security.d which are executable | |
53 | # and run them. Any script output is appended to the report | |
54 | # | |
55 | for f in `/bin/ls /etc/security.d/chk_*` | |
56 | do | |
57 | if [ -x $f ]; then | |
58 | rm -f $TMP1 | |
59 | $f > $TMP1 | |
60 | if [ -s $TMP1 ]; then | |
10 | 61 | if [ ! -f $SECOUT ]; then |
62 | echo "" >> $SECOUT | |
63 | echo " SlackSecCheckSripts v${VERSION}" >> $SECOUT | |
64 | echo "" >> $SECOUT | |
65 | fi | |
5 | 66 | cat $TMP1 >> $SECOUT |
67 | echo "" >> $SECOUT | |
68 | echo "------------------------------------------------------------------------------" >> $SECOUT | |
69 | fi | |
70 | fi | |
71 | done | |
72 | ||
73 | ||
74 | if [ ! -s "$SECOUT" ]; then | |
75 | echo "Nothing to report on $date" > $SECOUT | |
76 | fi | |
77 | env MAILRC=/dev/null mail -s "$fqdn daily insecurity output for $date" $MAILTO < $SECOUT | |
78 |