freebsd-skq/etc/periodic/daily/200.backup-passwd
pst 1d67bc6abb Copy /etc/cron.d to /etc/periodic per-request of many.
This wasn't done with a repository copy because there was no
history of any consequence.  Flames to me.
1997-08-16 17:04:02 +00:00

36 lines
944 B
Bash
Executable File

#!/bin/sh
#
# $Id: 200.backup-passwd,v 1.1.1.1 1997/08/12 17:51:15 pst Exp $
#
bak=/var/backups
if [ -f /etc/master.passwd -o -f /etc/group ] ; then
echo ""
echo "Backup passwd and group files:"
if [ ! -f $bak/master.passwd.bak ] ; then
echo "no $bak/master.passwd.bak"
cp -p /etc/master.passwd $bak/master.passwd.bak
fi
if cmp -s $bak/master.passwd.bak /etc/master.passwd; then :; else
echo "$host passwd diffs:"
diff $bak/master.passwd.bak /etc/master.passwd |\
sed 's/^\([<>] [^:]*\):[^:]*:/\1:(password):/'
mv $bak/master.passwd.bak $bak/master.passwd.bak2
cp -p /etc/master.passwd $bak/master.passwd.bak
fi
if [ ! -f $bak/group.bak ] ; then
echo "no $bak/group.bak"
cp -p /etc/group $bak/group.bak
fi
if cmp -s $bak/group.bak /etc/group; then :; else
echo "$host group diffs:"
diff $bak/group.bak /etc/group
mv $bak/group.bak $bak/group.bak2
cp -p /etc/group $bak/group.bak
fi
fi