xref: /dragonfly/etc/periodic/daily/130.clean-msgs (revision 279dd846)
1#!/bin/sh
2#
3# $FreeBSD: src/etc/periodic/daily/130.clean-msgs,v 1.3.2.2 2000/09/20 02:46:15 jkh Exp $
4# $DragonFly: src/etc/periodic/daily/130.clean-msgs,v 1.2 2003/06/17 04:24:48 dillon Exp $
5#
6# Remove system	messages
7#
8
9# If there is a global system configuration file, suck it in.
10#
11if [ -r /etc/defaults/periodic.conf ]
12then
13    . /etc/defaults/periodic.conf
14    source_periodic_confs
15fi
16
17case "$daily_clean_msgs_enable" in
18    [Yy][Ee][Ss])
19	if [ ! -d /var/msgs ]
20	then
21	    echo '$daily_clean_msgs_enable is set but /var/msgs' \
22		"doesn't exist"
23	    rc=2
24	else
25	    echo ""
26	    echo "Cleaning out old system announcements:"
27
28	    [ -n "$daily_clean_msgs_days" ] &&
29		arg=-${daily_clean_msgs_days#-} || arg=
30	    msgs -c $arg && rc=0 || rc=3
31	fi;;
32
33    *)  rc=0;;
34esac
35
36exit $rc
37