8824189ac87075ca1aab1b48442a2b5816daeb7a
[dragonfly.git] / etc / periodic / weekly / 300.uucp
1 #!/bin/sh -
2 #
3 # $FreeBSD: src/etc/periodic/weekly/300.uucp,v 1.3.2.2 2000/09/20 02:46:17 jkh Exp $
4 # $DragonFly: src/etc/periodic/weekly/Attic/300.uucp,v 1.2 2003/06/17 04:24:48 dillon Exp $
5 #
6 # This is really here for backwards compatibility, clean.weekly is not
7 # created by default anymore.
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 "$weekly_uucp_enable" in
18     [Yy][Ee][Ss])
19         if [ ! -d /var/spool/uucp ]
20         then
21             echo '$weekly_uucp_enable is set but /var/spool/uucp' \
22                 "doesn't exist"
23             rc=2
24         elif [ ! -x /usr/libexec/uucp/clean.weekly ]
25         then
26             echo '$weekly_uucp_enable is set but' \
27                 "/usr/libexec/uucp/clean.weekly isn't executable"
28             rc=2
29         else
30             echo ""
31             echo "Cleaning up UUCP:"
32
33             echo /usr/libexec/uucp/clean.weekly | su -m daemon && rc=0 || rc=3
34         fi;;
35
36     *)  rc=0;;
37 esac
38
39 exit $rc