DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential fakeroot devscripts postfix openssh-server bzr
# root's ssh stuff
-if [ ! -d /root/ssh ] && [ -d /home/martin/.ssh ]; then
+if [ ! -d /root/.ssh ] && [ -d /home/martin/.ssh ]; then
mkdir -p /root/.ssh
chmod 700 /root/.ssh
cp /home/martin/.ssh/id_dsa* /home/martin/.ssh/known_hosts /home/martin/.ssh/config /root/.ssh/
cd /etc
if [ ! -d /etc/.bzr ]; then
for i in passwd group shadow fstab; do
- cp $i $i.originst
+ [ -e $i.originst] || cp $i $i.originst
done
bzr get bzr+ssh://martin@piware.de/home/martin/backup/`hostname`-etc /backup-etc
cp -av /backup-etc/* /etc/
fi
# only restore dchroot part into fstab
-grep -A 200 "^# dchroots" fstab >> fstab.originst
+grep -A 200 "^# dchroots" fstab >> fstab.originst || true
mv fstab.originst fstab
# only restore the human users from passwd/group