cron.daily/security

changeset 18
2b7620bf17e6
parent 17
65656789da08
child 19
2c0dacb26b14
equal deleted inserted replaced
17:65656789da08 18:2b7620bf17e6
1 #!/bin/bash 1 #!/bin/bash
2 # 2 #
3 ############################################################################# 3 #############################################################################
4 # Copyright (C) 2005-2013 4 # Copyright (C) 2005-2014
5 # 5 #
6 # Michiel Broek <mbse at mbse.eu> 6 # Michiel Broek <mbse at mbse.eu>
7 # 7 #
8 # This file is part of SlackSecCheckSripts. 8 # This file is part of SlackSecCheckSripts.
9 # 9 #
20 # You should have received a copy of the GNU General Public License 20 # You should have received a copy of the GNU General Public License
21 # along with MBSE BBS; see the file COPYING. If not, write to the Free 21 # along with MBSE BBS; see the file COPYING. If not, write to the Free
22 # Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 22 # Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
23 ############################################################################# 23 #############################################################################
24 24
25 VERSION=0.18 25 VERSION=0.19
26 export PATH=/bin:/usr/bin:/sbin:/usr/sbin 26 export PATH=/bin:/usr/bin:/sbin:/usr/sbin
27 umask 077 27 umask 077
28 LANG=C; export LANG 28 LANG=C; export LANG
29 29
30 fqdn=`hostname -f` 30 fqdn=`hostname -f`
31 date=`date` 31 date=`date`
32 32
33 if [ "${MAILTO}" = "" ]; then 33 if [ "${MAILTO}" = "" ]; then
34 MAILTO=root@$fqdn 34 MAILTO=root
35 fi 35 fi
36 36
37 DAILYDIR=`mktemp -d /tmp/_daily.XXXXXX` || exit 1 37 DAILYDIR=`mktemp -d /tmp/_daily.XXXXXX` || exit 1
38 SECOUT="$DAILYDIR/secout" 38 SECOUT="$DAILYDIR/secout"
39 TMP1="$DAILYDIR/tmp1" 39 TMP1="$DAILYDIR/tmp1"
65 echo "------------------------------------------------------------------------------" >> $SECOUT 65 echo "------------------------------------------------------------------------------" >> $SECOUT
66 fi 66 fi
67 fi 67 fi
68 done 68 done
69 69
70
71 if [ ! -s "$SECOUT" ]; then
72 echo "Nothing to report on $date" > $SECOUT
73 fi
74 env MAILRC=/dev/null mail -s "$fqdn daily insecurity output for $date" $MAILTO < $SECOUT 70 env MAILRC=/dev/null mail -s "$fqdn daily insecurity output for $date" $MAILTO < $SECOUT
75

mercurial