Initial import from FreeBSD RELENG_4:
[dragonfly.git] / etc / periodic / daily / 340.uucp
1 #!/bin/sh
2 #
3 # $FreeBSD: src/etc/periodic/daily/340.uucp,v 1.4.2.2 2000/09/20 02:46:15 jkh Exp $
4 #
5 # Local cleanup of UUCP files.  This is for backwards compatibility,
6 # /etc/uuclean.daily doesn't exist by default.
7 #
8
9 # If there is a global system configuration file, suck it in.
10 #
11 if [ -r /etc/defaults/periodic.conf ]
12 then
13     . /etc/defaults/periodic.conf
14     source_periodic_confs
15 fi
16
17 case "$daily_uuclean_enable" in
18     [Yy][Ee][Ss])
19         if [ ! -d /var/spool/uucp ]
20         then
21             echo '$daily_uuclean_enable is set, but /var/spool/uucp' \
22                 "doesn't exist"
23             rc=2
24         elif [ ! -f /etc/uuclean.daily ]
25         then
26             echo '$daily_uuclean_enable is set, but /etc/uuclean.daily' \
27                 "doesn't exist"
28             rc=2
29         else
30             echo ""
31             echo "Cleaning up UUCP:"
32
33             echo /etc/uuclean.daily | su -m uucp && rc=0 || rc=3
34         fi;;
35
36     *)  rc=0;;
37 esac
38
39 exit $rc