Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / etc / periodic / daily / 220.backup-distfile
CommitLineData
984263bc
MD
1#!/bin/sh
2#
3# $FreeBSD: src/etc/periodic/daily/220.backup-distfile,v 1.3.2.2 2000/09/20 02:46:15 jkh Exp $
1de703da 4# $DragonFly: src/etc/periodic/daily/220.backup-distfile,v 1.2 2003/06/17 04:24:48 dillon Exp $
984263bc
MD
5#
6
7# If there is a global system configuration file, suck it in.
8#
9if [ -r /etc/defaults/periodic.conf ]
10then
11 . /etc/defaults/periodic.conf
12 source_periodic_confs
13fi
14
15case "$daily_backup_distfile_enable" in
16 [Yy][Ee][Ss])
17 if [ ! -f /etc/Distfile ]
18 then
19 echo '$daily_backup_distfile_enable is set but /etc/Distfile' \
20 "doesn't exist"
21 rc=2
22 else
23 bak=/var/backups
24 rc=0
25
26 echo ""
27 echo "Backing up /etc/Distfile:"
28
29 if ! cmp -s $bak/Distfile.bak /etc/Distfile
30 then
31 rc=1
32 mv $bak/Distfile.bak $bak/Distfile.bak2
33 cp /etc/Distfile $bak/Distfile.bak || rc=3
34 fi
35 fi;;
36
37 *) rc=0;;
38esac
39
40exit $rc