3 # $FreeBSD: src/etc/periodic/daily/200.backup-passwd,v 1.6.2.3 2001/11/17 22:42:46 cjc Exp $
4 # $DragonFly: src/etc/periodic/daily/200.backup-passwd,v 1.2 2003/06/17 04:24:48 dillon Exp $
7 # If there is a global system configuration file, suck it in.
9 if [ -r /etc
/defaults
/periodic.conf
]
11 .
/etc
/defaults
/periodic.conf
15 case "$daily_backup_passwd_enable" in
17 if [ ! -f /etc
/master.passwd
]
19 echo '$daily_backup_passwd_enable" is set but /etc/master.passwd' \
22 elif [ ! -f /etc
/group
]
24 echo '$daily_backup_passwd_enable" is set but /etc/group' \
32 echo "Backup passwd and group files:"
34 if [ ! -f $bak/master.passwd.bak
]
37 echo "no $bak/master.passwd.bak"
38 cp -p /etc
/master.passwd
$bak/master.passwd.bak || rc
=3
41 if ! cmp -s $bak/master.passwd.bak
/etc
/master.passwd
44 echo "$host passwd diffs:"
45 diff -I '^#' $bak/master.passwd.bak
/etc
/master.passwd |\
46 sed 's/^\([<>] [^:]*\):[^:]*:/\1:(password):/'
47 mv $bak/master.passwd.bak
$bak/master.passwd.bak2
48 cp -p /etc
/master.passwd
$bak/master.passwd.bak || rc
=3
51 if [ ! -f $bak/group.bak
]
54 echo "no $bak/group.bak"
55 cp -p /etc
/group
$bak/group.bak || rc
=3
58 if ! cmp -s $bak/group.bak
/etc
/group
61 echo "$host group diffs:"
62 diff $bak/group.bak
/etc
/group
63 mv $bak/group.bak
$bak/group.bak2
64 cp -p /etc
/group
$bak/group.bak || rc
=3
70 echo "Verifying group file syntax:"
71 chkgrp
/etc
/group || rc
=3