# completely
cd /etc
if [ ! -d /etc/.bzr ]; then
- #for i in passwd group shadow fstab; do
- for i in fstab; do
+ for i in passwd group shadow fstab; do
[ -e $i.originst ] || cp $i $i.originst
done
[ -e /backup-etc ] || bzr get bzr+ssh://martin@piware.de/home/martin/backup/`hostname`-etc /backup-etc
cp -av /backup-etc/.bzr/ /etc/
rm -rf /backup-etc
chmod 600 /etc/ssh/ssh_*_key
- #chmod 640 /etc/shadow
- #chown root:shadow /etc/shadow
+ chmod 640 /etc/shadow
+ chown root:shadow /etc/shadow
chmod 700 /etc/ssl/private
chmod 640 /etc/ssl/private/ssl-cert-*
chown root:ssl-cert /etc/ssl/private/ssl-cert*
mv fstab.originst fstab
# only restore the human users from passwd/group
- #for i in passwd group; do
- # perl -naF: -e 'print if $F[2] > 1000 && $F[2] < 60000' $i >> $i.originst
- # mv $i.originst $i
- #done
+ for i in passwd group; do
+ perl -naF: -e 'print if $F[2] > 1000 && $F[2] < 60000' $i >> $i.originst
+ mv $i.originst $i
+ done
# only restore some passwords from shadow
- #egrep 'martin|netti|joe' shadow >> shadow.originst
- #mv shadow.originst shadow
- #chown root:shadow shadow
- #chmod 640 shadow
+ egrep 'martin|netti|joe' shadow >> shadow.originst
+ mv shadow.originst shadow
+ chown root:shadow shadow
+ chmod 640 shadow
fi
# update postfix for new configuration