xref: /freebsd/usr.sbin/periodic/etc/monthly/450.status-security (revision 7fdf597e96a02165cfe22ff357b857d5fa15ed8a)
1#!/bin/sh
2#
3#
4
5# If there is a global system configuration file, suck it in.
6#
7if [ -r /etc/defaults/periodic.conf ]
8then
9    . /etc/defaults/periodic.conf
10    source_periodic_confs
11fi
12
13case "$monthly_status_security_enable" in
14    [Yy][Ee][Ss])
15	echo ""
16	echo "Security check:"
17
18	case "$monthly_status_security_inline" in
19	    [Yy][Ee][Ss])
20		monthly_status_security_output="";;
21	esac
22
23	export security_output="${monthly_status_security_output}"
24	rc=0
25	case "${monthly_status_security_output}" in
26	    "")
27		if tempfile=`mktemp ${TMPDIR:-/tmp}/450.status-security.XXXXXX`
28		then
29			periodic security > $tempfile || rc=3
30			if [ -s "$tempfile" ]; then
31				cat "$tempfile"
32				rc=3
33			fi
34			rm -f "$tempfile"
35		fi;;
36	    /*)
37		echo "    (output logged separately)"
38		periodic security || rc=3;;
39	    *)
40		echo "    (output mailed separately)"
41		periodic security || rc=3;;
42	esac;;
43    *)  rc=0;;
44esac
45
46exit $rc
47