]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - etc/periodic/daily/130.clean-msgs
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / etc / periodic / daily / 130.clean-msgs
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5 # Remove system messages
6 #
7
8 # If there is a global system configuration file, suck it in.
9 #
10 if [ -r /etc/defaults/periodic.conf ]
11 then
12     . /etc/defaults/periodic.conf
13     source_periodic_confs
14 fi
15
16 case "$daily_clean_msgs_enable" in
17     [Yy][Ee][Ss])
18         if [ ! -d /var/msgs ]
19         then
20             echo '$daily_clean_msgs_enable is set but /var/msgs' \
21                 "doesn't exist"
22             rc=2
23         else
24             echo ""
25             echo "Cleaning out old system announcements:"
26
27             [ -n "$daily_clean_msgs_days" ] &&
28                 arg=-${daily_clean_msgs_days#-} || arg=
29             msgs -c $arg && rc=0 || rc=3
30         fi;;
31
32     *)  rc=0;;
33 esac
34
35 exit $rc