Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / etc / periodic / daily / 210.backup-aliases
CommitLineData
984263bc
MD
1#!/bin/sh
2#
3# $FreeBSD: src/etc/periodic/daily/210.backup-aliases,v 1.3.2.3 2000/09/20 02:46:15 jkh Exp $
1de703da 4# $DragonFly: src/etc/periodic/daily/210.backup-aliases,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_aliases_enable" in
16 [Yy][Ee][Ss])
17 if [ ! -f /etc/mail/aliases ]
18 then
19 echo '$daily_backup_aliases_enable is enabled but' \
20 "/etc/mail/aliases doesn't exist"
21 rc=2
22 else
23 bak=/var/backups
24 rc=0
25
26 echo ""
27 echo "Backing up mail aliases:"
28
29 if [ ! -f $bak/aliases.bak ]
30 then
31 echo "no $bak/aliases.bak"
32 cp -p /etc/mail/aliases $bak/aliases.bak || rc=3
33 fi
34
35 if ! cmp -s $bak/aliases.bak /etc/mail/aliases
36 then
37 [ $rc -lt 1 ] && rc=1
38 echo "$host aliases diffs:"
39 diff -u $bak/aliases.bak /etc/mail/aliases
40 mv $bak/aliases.bak $bak/aliases.bak2
41 cp -p /etc/mail/aliases $bak/aliases.bak || rc=3
42 fi
43 fi;;
44
45 *) rc=0;;
46esac
47
48exit $rc