mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-25 03:54:17 +01:00
If no passwd.bak/group.bak/aliases.bak exists, put warning and make them,
commands failed in old case Produce diffs on group and aliases too
This commit is contained in:
parent
44436d27fe
commit
9b6002ae5a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=10756
16
etc/daily
16
etc/daily
@ -49,17 +49,33 @@ fi
|
||||
|
||||
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
|
||||
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
|
||||
if [ ! -f $bak/aliases.bak ] ; then
|
||||
echo "no $bak/aliases.bak"
|
||||
cp -p /etc/aliases $bak/aliases.bak
|
||||
fi
|
||||
if cmp -s $bak/aliases.bak /etc/aliases; then :; else
|
||||
echo "$host aliases diffs:"
|
||||
diff $bak/aliases.bak /etc/aliases
|
||||
mv $bak/aliases.bak $bak/aliases.bak2
|
||||
cp -p /etc/aliases $bak/aliases.bak
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user