aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/periodic/etc/weekly/450.status-security
blob: 8bb0c02859c41bcccbf550f8d3a5d232e0951ae6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/sh
#
#

# If there is a global system configuration file, suck it in.
#
if [ -r /etc/defaults/periodic.conf ]
then
    . /etc/defaults/periodic.conf
    source_periodic_confs
fi

case "$weekly_status_security_enable" in
    [Yy][Ee][Ss])
	echo ""
	echo "Security check:"

	case "$weekly_status_security_inline" in
	    [Yy][Ee][Ss])
		weekly_status_security_output="";;
	esac

	export security_output="${weekly_status_security_output}"
	rc=0
	case "${weekly_status_security_output}" in
	    "")
		if tempfile=`mktemp ${TMPDIR:-/tmp}/450.status-security.XXXXXX`
		then
			periodic security > $tempfile || rc=3
			if [ -s "$tempfile" ]; then
				cat "$tempfile"
				rc=3
			fi
			rm -f "$tempfile"
		fi;;
	    /*)
		echo "    (output logged separately)"
		periodic security || rc=3;;
	    *)
		echo "    (output mailed separately)"
		periodic security || rc=3;;
	esac;;
    *)  rc=0;;
esac

exit $rc